Verificación de Programas!
|
|
- Imogen McDonald
- 5 years ago
- Views:
Transcription
1 Verificación de Programas! rafael ramirez (Tanger)
2 Porque verificar programas Debido a un error de programación, el cohete que llevaba al Mariner I, en viaje sin tripulación a Venus, tuvo que ser destruido 290 segundos despues de su lanzamiento en Julio 22, Programa (in pseudocode): if in radar contact with rocket then do not correct its flight path. not
3 Chairman: Who was responsible for leaving this [not] out? Mr Wyatt: It was a human error Mr Fulton: Does NASA check to see that the computers are correctly [programmed]? Doesn t any outside inspector check, or is it just up to the programmer and if he does not do it nobody else knows about it? Dr Morrison: This is a minute detail of the [program], which I agree should be checked. However, in good management practices, if we followed every detail to this point, we would have a tremendous staff. Mr Fulton: ths loss up to $18 or $20 million, plus the time, plus the loss of prestige would seem to me to require a system of checking to see that the contractor programmed correctly Dr Morrison: This is true. I would like to point out there were 300 runs made of this program; the error was not uncovered Mr Fulton: My point is that we know of one [error], but we do not know if there were others Mr Waggonner: I share your concern there. I would have to be reluctant to say we hire enough personnel to check every [programmer]. That would mean two people doing every job a man checking every man Chairman: I feel that I have a vague knowledge of what you are talking about, but we certainly should be able to devise some system for checks that will not allow this type of error to creep in. (31/7/62 Hearing before the Commiittee)
4 Program verification Becoming more concerned with correctness and reliability of programs Main correctness issues: 1. Given a program P, what does it mean? What is its specification? 2. Given a specification S, develop a program P that implements S. 3. Do specification S and program P perform the same function? 4. Semantic modeling 5. Program synthesis, central problem in software engineering. 6. Central problem in program verification
5 Program verification Program computes a function Suppose that From the program it were possible to determine this function We have a separate specification of the desired function from the initial design If we can prove that the two functions are the same, then we would prove the program is correct. Predicate calculus particularly useful for specifying complex relations/functions precisely. Several verification approaches, same idea: Desired function specified using predicate calculus Program analyzed to check if the computed function is the same as the specified one.
6 Program verification Validation: Demonstrating that a program meets its specifications by testing the program against a series of data sets Verification: Demonstrating that a program meets its specifications by a formal argument based upon the structure of the program. Validation assumes a particular execution of the program; verification does not. Tony Hoare developed method in Each program statement obeys a formal axiomatic definition.
7 Axiomatic Semantics Axiomatic semantics allows us to prove correctness of programs. The central idea in axiomatic semantics is that of an assertion: some property of program state at a particular control location
8 Assertions: Example { true } if (a >= b) m := a ; else m := b { m = max(a,b) } If we can prove the assertions above, we have proved correctness of the above code fragment.
9 Proving Programs Deductive System HL (axioms) Consequence1 {P}S{R}, R Q [Add postcondition] {P}S{Q} Consequence2 P R, {R}S{Q} [Add precondition] {P}S{Q} Composition {P}S1{Q},{Q}S2{R} [Combine statements] {P}S1;S2{R} Assignment true {P(expr)} x:=expr {P(x)}. Conditional {PB}S1{Q}, {P (B)}S2{Q} {P}if B then S1 else S2{Q} While {PB}S{P} {P}while B do S{P (B)} [P is an invariant] Every theorem in the domain(s) of the program is an axiom
10 Weakest precondition The weaker the predicate, the more states satify it. For a given S and Q in the triplet A: {P}S{Q}, P is said to be the weakest precondition in A if P is the weakest formula that satisfies A.
11 Rule for if-then-else {P B}c0{Q} {P B}c1{Q} {P} if B then c0 else c1 {Q} {a>=b}m := a{m = max(a; b)} {a <b}m := b{m = max(a; b)} {true} if a>=b then m:=a else m:=b {m = max(a; b)} Now prove {a >= b}m := a{m = max(a; b)} and {a < b}m := b{m = max(a; b)}
12 Rule for assignment true {Q(e)} x := e {Q(x)} We need to prove {a >= b}m := a{m = max(a, b)} Using the above rule we can only prove: {a = max(a, b)}m := a{m = max(a, b)}
13 Rule of Consequence P P' {P } C {Q} {P} C {Q} Set P = (a >= b), P = (a = max(a, b)) Q = (m = max(a, b)) Then P P Therefore {a >= b}m := a{m = max(a; b)} holds.
14 Assertions: Example summary { true } if (a >= b) m := a else m := b { m = max(a,b) } true {Q[x\e]} x := e {Q(x)} true (a >= b) (a = max(a, b)) {a = max(a, b)}m := a{m = max(a, b)} {a>=b}m := a{m = max(a; b)} {a <b}m := b{m = max(a; b)} {true} if a>=b then m:=a else m:=b {m = max(a; b)} P P' {P } C {Q} {P} C {Q} {P B}c0{Q} {P B}c1 {Q} {P} if B then c0 else c1 {Q}
15 Other rules Rule of sequences {P} C1 {R} {R} C2 {Q} {P} C1;C2 {Q} Rule of loop invariants {Cond P} Body {P} {P} while Cond do Body{ Cond P} P is a loop invariant: true after every iteration of the loop.
16 Proving Programs Deductive System HL (axioms) Consequence1 {P}S{R}, R Q [Add postcondition] {P}S{Q} Consequence2 P R, {R}S{Q} [Add precondition] {P}S{Q} Composition {P}S1{Q},{Q}S2{R} [Combine statements] {P}S1;S2{R} Assignment true {P(expr)} x:=expr {P(x)}. Conditional {PB}S1{Q}, {P (B)}S2{Q} {P}if B then S1 else S2{Q} While {PB}S{P} {P}while B do S{P (B)} [P is an invariant] Every theorem in the domain(s) of the program is an axiom
17 Axiomatic program proof Given program: s1; s2; s3; s4; sn and specifications P and Q: P is the precondition Q is the postcondition Show that {P}s1; sn{q} by showing: {P}s1{p1} {p1}s2{p2} {pn-1}sn{q} Repeated applications of composition yield: {P}s1; ; sn{q}
18 Example proof {B 0} 1 MULT(A,B) = { 2 a:=a; 3 b:=b 4 y:=0 5 while b>0 do begin 6 y:= y+a 7 b:= b-1 end } {Y=A B} Show program computes y=a B (given that initially B 0)
19 Proof outline General method is to work backwards: Derive antecedent from consequent Need to develop invariants for while loop (lines 5-7) y is increased by a as b is decreased by 1 Proposed invariant: (y+ab = AB) (b 0)
20 While Loop. 5 while b>0 do begin 6 y:= y+a 7 b:= b-1 end } {Y=A B} y is increased by a as b is decreased by 1 Proposed invariant: (y+ab = AB) (b 0)
21 While Loop. 5 while b>0 do begin 6 y:= y+a 7 b:= b-1 end } {Y=A B} Composition {P}S1{Q},{Q}S2{R} {P}S1;S2{R} Assignment true {P(expr)} x:=expr {P(x)}. (a) {y+a(b-1)=ab (b-1) 0} b:=b-1 {y+ab=ab b 0} Assig. 7 (b) {y+ab=ab b-1 0} y:=y+a {y+a(b-1)=ab b-1 0} Assig. 6 (c) {y+ab=ab b-1>=0)} y:=y+a; b:=b-1 {y+ab=ab b 0} Comp.(a,b)
22 While Loop. 5 while b>0 do begin 6 y:= y+a 7 b:= b-1 end } {Y=A B} Consequence2 P R, {R}S{Q} {P}S{Q} While {PB}S{P} {P}while B do S{P (B)} [P is an invariant] (c) {y+ab=ab b-1>=0)} y:=y+a; b:=b-1 {y+ab=ab b 0} Comp.(a,b) (d) (y+ab=ab (b 0) (b>0) (y+ab=ab) b-1 0) Theorem (e) {y+ab=ab(b 0)(b>0)} y:=y+a; b:=b-1 {y+ab=ab b 0}Conc2(c,d) (f) {y+ab=abb 0} while(b>0)... {y+ab=ab b 0 b>0} while(5,e)
23 Proof (a) {y+a(b-1)=ab (b-1) 0} b:=b-1 {y+ab=ab b 0} Assig. 7 (b) {y+ab=ab b-1 0} y:=y+a {y+a(b-1)=ab b-1 0} Assig. 6 (c) {y+ab=ab b-1>=0)} y:=y+a; b:=b-1 {y+ab=ab b 0} Comp.(a,b) (d) (y+ab=ab) (b 0) (b>0) (y+ab=ab) b-1 0) Theorem (e) {y+ab=ab (b 0) (b>0)} y:=y+a; b:=b-1 {y+ab=ab b 0} Conc2(c,d) (f) {y+ab=ab b 0} while(b>0)... {y+ab=ab b 0 b>0} while(5,e) (g) {0+ab=AB b 0} y:=0 {y+ab=ab b 0} Assig.(4,f) (h) {0+aB=AB B 0} b:=b {0+ab=AB b 0} Assig. (3,g) (i) {0+AB=AB B 0} a:=a {0+aB=AB B 0} Assig. (2,h) (j) B 0 0+AB=AB B 0 Theorem (k) {B 0} a:=a {0+AB=AB B 0} Conc2 (l) {B 0} a:=a; b:=b; y:=0 {y+ab=ab b 0} Comp.(k,h,g) (m) {B 0} MULT(A,B) {y+ab=ab b 0 b>0} Comp.(l,f) (n) y+ab=ab b 0 b>0 (b=0) (y=ab) Theorem (o) {B>0} MULT(A,B) {y=ab} Conc1(m,n)
24 Example 2 {n 0} j := 0; x := 1; while j < n do j := j + 1; x := 2 * x {x:=2^n}
25 Example 2 {n 0} j := 0; x := 1; while j < n do j := j + 1; x := 2 * x {x=2^n} Loop invariant: x=2^j & 0 j n
26 Example 3 y := 1; z := 0; while (z!= x) do { z := z + 1; y := y * z }
27 Example 3 {true} y := 1; z := 0; while (z!= x) do { z := z + 1; y := y * z } {y=x!} Consequence2 P R, {R}S{Q} {P}S{Q} While {PB}S{P} {P}while B do S{P (B)} [P is an invariant] Loop invariant: y=z!
28 Proof Must also show that the program terminates This reduces to show that while statement terminates Show that there is some property that is always positive in loop (e.g. b 0) Show that this property decreases in loop (e.g.b:=b-1) If both properties remain true, loop must terminate. {PB 0 E=E0}S{P 0 E <E0} {P 0 E}while B do S{P (B)}
29 Summary Axiomatic verification Precise Basis for most other verification methods, including semiformal specification notations. Axiomatic verification tedious to apply to real (large) programs. Today, there are systems that semi-automate the process (little or no human interaction) Important in critical applications. Program proving also useful during program design. Program proved as it is written. Impact of axiomatic verification has been in programming language design. Some languages (e.g. C++) include an assert capability based somewhat in axiomatic semantics. Assertion placed in the source program and the program tests the assertion as it executes. Not a proof of correctness of program but does catch many errors.
Dynamic Semantics. Dynamic Semantics. Operational Semantics Axiomatic Semantics Denotational Semantic. Operational Semantics
Dynamic Semantics Operational Semantics Denotational Semantic Dynamic Semantics Operational Semantics Operational Semantics Describe meaning by executing program on machine Machine can be actual or simulated
More informationWhat happens to the value of the expression x + y every time we execute this loop? while x>0 do ( y := y+z ; x := x:= x z )
Starter Questions Feel free to discuss these with your neighbour: Consider two states s 1 and s 2 such that s 1, x := x + 1 s 2 If predicate P (x = y + 1) is true for s 2 then what does that tell us about
More informationProgramming Languages and Compilers (CS 421)
Programming Languages and Compilers (CS 421) Sasa Misailovic 4110 SC, UIUC https://courses.engr.illinois.edu/cs421/fa2017/cs421a Based in part on slides by Mattox Beckman, as updated by Vikram Adve, Gul
More informationHoare Logic I. Introduction to Deductive Program Verification. Simple Imperative Programming Language. Hoare Logic. Meaning of Hoare Triples
Hoare Logic I Introduction to Deductive Program Verification Işıl Dillig Program Spec Deductive verifier FOL formula Theorem prover valid contingent Example specs: safety (no crashes), absence of arithmetic
More informationProgram verification. 18 October 2017
Program verification 18 October 2017 Example revisited // assume(n>2); void partition(int a[], int n) { int pivot = a[0]; int lo = 1, hi = n-1; while (lo
More informationProofs of Correctness: Introduction to Axiomatic Verification
Proofs of Correctness: Introduction to Axiomatic Verification Introduction Weak correctness predicate Assignment statements Sequencing Selection statements Iteration 1 Introduction What is Axiomatic Verification?
More informationLast Time. Inference Rules
Last Time When program S executes it switches to a different state We need to express assertions on the states of the program S before and after its execution We can do it using a Hoare triple written
More informationDeterministic Program The While Program
Deterministic Program The While Program Shangping Ren Department of Computer Science Illinois Institute of Technology February 24, 2014 Shangping Ren Deterministic Program The While Program February 24,
More informationWeakest Precondition Calculus
Weakest Precondition Calculus COMP2600 Formal Methods for Software Engineering Rajeev Goré Australian National University Semester 2, 2016 (Most lecture slides due to Ranald Clouston) COMP 2600 Weakest
More informationAxiomatic Semantics. Hoare s Correctness Triplets Dijkstra s Predicate Transformers
Axiomatic Semantics Hoare s Correctness Triplets Dijkstra s Predicate Transformers Goal of a program = IO Relation Problem Specification Properties satisfied by the input and expected of the output (usually
More informationSpring 2015 Program Analysis and Verification. Lecture 4: Axiomatic Semantics I. Roman Manevich Ben-Gurion University
Spring 2015 Program Analysis and Verification Lecture 4: Axiomatic Semantics I Roman Manevich Ben-Gurion University Agenda Basic concepts of correctness Axiomatic semantics (pages 175-183) Hoare Logic
More informationCOP4020 Programming Languages. Introduction to Axiomatic Semantics Prof. Robert van Engelen
COP4020 Programming Languages Introduction to Axiomatic Semantics Prof. Robert van Engelen Assertions and Preconditions Assertions are used by programmers to verify run-time execution An assertion is a
More informationAxiomatic Semantics. Semantics of Programming Languages course. Joosep Rõõmusaare
Axiomatic Semantics Semantics of Programming Languages course Joosep Rõõmusaare 2014 Direct Proofs of Program Correctness Partial correctness properties are properties expressing that if a given program
More informationHoare Logic: Part II
Hoare Logic: Part II COMP2600 Formal Methods for Software Engineering Jinbo Huang Australian National University COMP 2600 Hoare Logic II 1 Factorial {n 0} fact := 1; i := n; while (i >0) do fact := fact
More informationHoare Logic: Reasoning About Imperative Programs
Hoare Logic: Reasoning About Imperative Programs COMP1600 / COMP6260 Dirk Pattinson Australian National University Semester 2, 2018 Programming Paradigms Functional. (Haskell, SML, OCaml,... ) main paradigm:
More informationProgram verification using Hoare Logic¹
Program verification using Hoare Logic¹ Automated Reasoning - Guest Lecture Petros Papapanagiotou Part 2 of 2 ¹Contains material from Mike Gordon s slides: Previously on Hoare Logic A simple while language
More informationProgram Analysis Part I : Sequential Programs
Program Analysis Part I : Sequential Programs IN5170/IN9170 Models of concurrency Program Analysis, lecture 5 Fall 2018 26. 9. 2018 2 / 44 Program correctness Is my program correct? Central question for
More informationHoare Logic: Reasoning About Imperative Programs
Hoare Logic: Reasoning About Imperative Programs COMP1600 / COMP6260 Dirk Pattinson Australian National University Semester 2, 2017 Catch Up / Drop in Lab When Fridays, 15.00-17.00 Where N335, CSIT Building
More informationFoundations of Computation
The Australian National University Semester 2, 2018 Research School of Computer Science Tutorial 6 Dirk Pattinson Foundations of Computation The tutorial contains a number of exercises designed for the
More informationThe Assignment Axiom (Hoare)
The Assignment Axiom (Hoare) Syntax: V := E Semantics: value of V in final state is value of E in initial state Example: X:=X+ (adds one to the value of the variable X) The Assignment Axiom {Q[E/V ]} V
More informationAxiomatic Semantics. Lecture 9 CS 565 2/12/08
Axiomatic Semantics Lecture 9 CS 565 2/12/08 Axiomatic Semantics Operational semantics describes the meaning of programs in terms of the execution steps taken by an abstract machine Denotational semantics
More informationCS558 Programming Languages
CS558 Programming Languages Winter 2017 Lecture 2b Andrew Tolmach Portland State University 1994-2017 Semantics Informal vs. Formal Informal semantics Descriptions in English (or other natural language)
More informationFormal Specification and Verification. Specifications
Formal Specification and Verification Specifications Imprecise specifications can cause serious problems downstream Lots of interpretations even with technicaloriented natural language The value returned
More informationTHE AUSTRALIAN NATIONAL UNIVERSITY Second Semester COMP2600/COMP6260 (Formal Methods for Software Engineering)
THE AUSTRALIAN NATIONAL UNIVERSITY Second Semester 2016 COMP2600/COMP6260 (Formal Methods for Software Engineering) Writing Period: 3 hours duration Study Period: 15 minutes duration Permitted Materials:
More informationLecture Notes: Axiomatic Semantics and Hoare-style Verification
Lecture Notes: Axiomatic Semantics and Hoare-style Verification 17-355/17-665/17-819O: Program Analysis (Spring 2018) Claire Le Goues and Jonathan Aldrich clegoues@cs.cmu.edu, aldrich@cs.cmu.edu It has
More informationClassical Program Logics: Hoare Logic, Weakest Liberal Preconditions
Chapter 1 Classical Program Logics: Hoare Logic, Weakest Liberal Preconditions 1.1 The IMP Language IMP is a programming language with an extensible syntax that was developed in the late 1960s. We will
More informationSpring 2016 Program Analysis and Verification. Lecture 3: Axiomatic Semantics I. Roman Manevich Ben-Gurion University
Spring 2016 Program Analysis and Verification Lecture 3: Axiomatic Semantics I Roman Manevich Ben-Gurion University Warm-up exercises 1. Define program state: 2. Define structural semantics configurations:
More informationVerifying Properties of Parallel Programs: An Axiomatic Approach
Verifying Properties of Parallel Programs: An Axiomatic Approach By Susan Owicki and David Gries (1976) Nathan Wetzler nwetzler@cs.utexas.edu University of Texas, Austin November 3, 2009 Outline Introduction
More informationICS141: Discrete Mathematics for Computer Science I
ICS141: Discrete Mathematics for Computer Science I Dept. Information & Computer Sci., Jan Stelovsky based on slides by Dr. Baek and Dr. Still Originals by Dr. M. P. Frank and Dr. J.L. Gross Provided by
More informationProgram verification. Hoare triples. Assertional semantics (cont) Example: Semantics of assignment. Assertional semantics of a program
Program verification Assertional semantics of a program Meaning of a program: relation between its inputs and outputs; specified by input assertions (pre-conditions) and output assertions (post-conditions)
More informationAxiomatic Semantics. Operational semantics. Good for. Not good for automatic reasoning about programs
Review Operational semantics relatively l simple many flavors (small vs. big) not compositional (rule for while) Good for describing language implementation reasoning about properties of the language eg.
More informationFormal Reasoning CSE 331. Lecture 2 Formal Reasoning. Announcements. Formalization and Reasoning. Software Design and Implementation
CSE 331 Software Design and Implementation Lecture 2 Formal Reasoning Announcements Homework 0 due Friday at 5 PM Heads up: no late days for this one! Homework 1 due Wednesday at 11 PM Using program logic
More informationAxiomatic Semantics. Stansifer Ch 2.4, Ch. 9 Winskel Ch.6 Slonneger and Kurtz Ch. 11 CSE
Axiomatic Semantics Stansifer Ch 2.4, Ch. 9 Winskel Ch.6 Slonneger and Kurtz Ch. 11 CSE 6341 1 Outline Introduction What are axiomatic semantics? First-order logic & assertions about states Results (triples)
More informationMid-Semester Quiz Second Semester, 2012
THE AUSTRALIAN NATIONAL UNIVERSITY Mid-Semester Quiz Second Semester, 2012 COMP2600 (Formal Methods for Software Engineering) Writing Period: 1 hour duration Study Period: 10 minutes duration Permitted
More informationVerification and Validation
2010-2011 Cycle Ingénieur 2 ème année Département Informatique Verification and Validation Part IV : Proof-based Verification (III) Burkhart Wolff Département Informatique Université Paris-Sud / Orsay
More informationHoare Calculus and Predicate Transformers
Hoare Calculus and Predicate Transformers Wolfgang Schreiner Wolfgang.Schreiner@risc.uni-linz.ac.at Research Institute for Symbolic Computation (RISC) Johannes Kepler University, Linz, Austria http://www.risc.uni-linz.ac.at
More informationFloyd-Hoare Style Program Verification
Floyd-Hoare Style Program Verification Deepak D Souza Department of Computer Science and Automation Indian Institute of Science, Bangalore. 9 Feb 2017 Outline of this talk 1 Overview 2 Hoare Triples 3
More informationFirst Order Logic vs Propositional Logic CS477 Formal Software Dev Methods
First Order Logic vs Propositional Logic CS477 Formal Software Dev Methods Elsa L Gunter 2112 SC, UIUC egunter@illinois.edu http://courses.engr.illinois.edu/cs477 Slides based in part on previous lectures
More informationDeductive Verification
Deductive Verification Mooly Sagiv Slides from Zvonimir Rakamaric First-Order Logic A formal notation for mathematics, with expressions involving Propositional symbols Predicates Functions and constant
More informationHoare Logic and Model Checking
Hoare Logic and Model Checking Kasper Svendsen University of Cambridge CST Part II 2016/17 Acknowledgement: slides heavily based on previous versions by Mike Gordon and Alan Mycroft Introduction In the
More informationHoare Logic (I): Axiomatic Semantics and Program Correctness
Hoare Logic (I): Axiomatic Semantics and Program Correctness (Based on [Apt and Olderog 1991; Gries 1981; Hoare 1969; Kleymann 1999; Sethi 199]) Yih-Kuen Tsay Dept. of Information Management National Taiwan
More informationCSC 7101: Programming Language Structures 1. Axiomatic Semantics. Stansifer Ch 2.4, Ch. 9 Winskel Ch.6 Slonneger and Kurtz Ch. 11.
Axiomatic Semantics Stansifer Ch 2.4, Ch. 9 Winskel Ch.6 Slonneger and Kurtz Ch. 11 1 Overview We ll develop proof rules, such as: { I b } S { I } { I } while b do S end { I b } That allow us to verify
More informationAxiomatic Semantics: Verification Conditions. Review of Soundness of Axiomatic Semantics. Questions? Announcements
Axiomatic Semantics: Verification Conditions Meeting 18, CSCI 5535, Spring 2010 Announcements Homework 6 is due tonight Today s forum: papers on automated testing using symbolic execution Anyone looking
More informationSoftware Engineering
Software Engineering Lecture 07: Design by Contract Peter Thiemann University of Freiburg, Germany 02.06.2014 Table of Contents Design by Contract Contracts for Procedural Programs Contracts for Object-Oriented
More informationAxiomatic Verification II
Axiomatic Verification II Software Testing and Verification Lecture Notes 18 Prepared by Stephen M. Thebaut, Ph.D. University of Florida Axiomatic Verification II Reasoning about iteration (while loops)
More informationA Short Introduction to Hoare Logic
A Short Introduction to Hoare Logic Supratik Chakraborty I.I.T. Bombay June 23, 2008 Supratik Chakraborty (I.I.T. Bombay) A Short Introduction to Hoare Logic June 23, 2008 1 / 34 Motivation Assertion checking
More informationPropositional Logic: Syntax
Logic Logic is a tool for formalizing reasoning. There are lots of different logics: probabilistic logic: for reasoning about probability temporal logic: for reasoning about time (and programs) epistemic
More informationSpring 2014 Program Analysis and Verification. Lecture 6: Axiomatic Semantics III. Roman Manevich Ben-Gurion University
Spring 2014 Program Analysis and Verification Lecture 6: Axiomatic Semantics III Roman Manevich Ben-Gurion University Syllabus Semantics Static Analysis Abstract Interpretation fundamentals Analysis Techniques
More informationReasoning About Imperative Programs. COS 441 Slides 10b
Reasoning About Imperative Programs COS 441 Slides 10b Last time Hoare Logic: { P } C { Q } Agenda If P is true in the initial state s. And C in state s evaluates to s. Then Q must be true in s. Program
More informationAxiomatic Semantics: Verification Conditions. Review of Soundness and Completeness of Axiomatic Semantics. Announcements
Axiomatic Semantics: Verification Conditions Meeting 12, CSCI 5535, Spring 2009 Announcements Homework 4 is due tonight Wed forum: papers on automated testing using symbolic execution 2 Questions? Review
More informationProof Calculus for Partial Correctness
Proof Calculus for Partial Correctness Bow-Yaw Wang Institute of Information Science Academia Sinica, Taiwan September 7, 2016 Bow-Yaw Wang (Academia Sinica) Proof Calculus for Partial Correctness September
More informationTHE AUSTRALIAN NATIONAL UNIVERSITY Second Semester COMP2600 (Formal Methods for Software Engineering)
THE AUSTRALIAN NATIONAL UNIVERSITY Second Semester 2012 COMP2600 (Formal Methods for Software Engineering) Writing Period: 3 hours duration Study Period: 15 minutes duration Permitted Materials: One A4
More informationProof Rules for Correctness Triples
Proof Rules for Correctness Triples CS 536: Science of Programming, Fall 2018 A. Why? We can t generally prove that correctness triples are valid using truth tables. We need proof axioms for atomic statements
More informationFormal Verification of Mathematical Algorithms
Formal Verification of Mathematical Algorithms 1 Formal Verification of Mathematical Algorithms John Harrison Intel Corporation The cost of bugs Formal verification Levels of verification HOL Light Formalizing
More informationPredicate Transforms I
Predicate Transforms I Software Testing and Verification Lecture Notes 19 Prepared by Stephen M. Thebaut, Ph.D. University of Florida Predicate Transforms I 1. Introduction: weakest pre-conditions (wp
More informationIntroduction. Pedro Cabalar. Department of Computer Science University of Corunna, SPAIN 2013/2014
Introduction Pedro Cabalar Department of Computer Science University of Corunna, SPAIN cabalar@udc.es 2013/2014 P. Cabalar ( Department Introduction of Computer Science University of Corunna, SPAIN2013/2014
More informationSpring 2015 Program Analysis and Verification. Lecture 6: Axiomatic Semantics III. Roman Manevich Ben-Gurion University
Spring 2015 Program Analysis and Verification Lecture 6: Axiomatic Semantics III Roman Manevich Ben-Gurion University Tentative syllabus Semantics Static Analysis Abstract Interpretation fundamentals Analysis
More informationCSE 331 Winter 2018 Homework 1
Directions: - Due Wednesday, January 10 by 11 pm. - Turn in your work online using gradescope. You should turn in a single pdf file. You can have more than one answer per page, but please try to avoid
More informationLogic. Propositional Logic: Syntax
Logic Propositional Logic: Syntax Logic is a tool for formalizing reasoning. There are lots of different logics: probabilistic logic: for reasoning about probability temporal logic: for reasoning about
More informationSoundness and Completeness of Axiomatic Semantics
#1 Soundness and Completeness of Axiomatic Semantics #2 One-Slide Summary A system of axiomatic semantics is sound if everything we can prove is also true: if ` { A } c { B } then ² { A } c { B } We prove
More informationIntroduction to Axiomatic Semantics
#1 Introduction to Axiomatic Semantics #2 How s The Homework Going? Remember that you can t just define a meaning function in terms of itself you must use some fixed point machinery. #3 Observations A
More informationIn this episode of The Verification Corner, Rustan Leino talks about Loop Invariants. He gives a brief summary of the theoretical foundations and
In this episode of The Verification Corner, Rustan Leino talks about Loop Invariants. He gives a brief summary of the theoretical foundations and shows how a program can sometimes be systematically constructed
More informationBilateral Proofs of Safety and Progress Properties of Concurrent Programs (Working Draft)
Bilateral Proofs of Safety and Progress Properties of Concurrent Programs (Working Draft) Jayadev Misra December 18, 2015 Contents 1 Introduction 3 2 Program and Execution Model 4 2.1 Program Structure..........................
More informationMarie Farrell Supervisors: Dr Rosemary Monahan & Dr James Power Principles of Programming Research Group
EXAMINING REFINEMENT: THEORY, TOOLS AND MATHEMATICS Marie Farrell Supervisors: Dr Rosemary Monahan & Dr James Power Principles of Programming Research Group PROBLEM Different formalisms do not integrate
More informationCSE 331 Software Design & Implementation
CSE 331 Software Design & Implementation Kevin Zatloukal Summer 2017 Lecture 2 Reasoning About Code With Logic (Based on slides by Mike Ernst, Dan Grossman, David Notkin, Hal Perkins, Zach Tatlock) Recall
More informationProgram Analysis and Verification
Program Analysis and Verification 0368-4479 Noam Rinetzky Lecture 4: Axiomatic Semantics Slides credit: Tom Ball, Dawson Engler, Roman Manevich, Erik Poll, Mooly Sagiv, Jean Souyris, Eran Tromer, Avishai
More informationLogic. Propositional Logic: Syntax. Wffs
Logic Propositional Logic: Syntax Logic is a tool for formalizing reasoning. There are lots of different logics: probabilistic logic: for reasoning about probability temporal logic: for reasoning about
More informationHoare Calculus for SIMT Programms
Introduction The extension of the Hoare Logic Proof of Equivalence Conclusion and Future Work Hoare Calculus for SIMT Programms Viktor Leonhardt Embedded Systems Group Department of Computer Science University
More informationSolutions to exercises for the Hoare logic (based on material written by Mark Staples)
Solutions to exercises for the Hoare logic (based on material written by Mark Staples) Exercise 1 We are interested in termination, so that means we need to use the terminology of total correctness, i.e.
More informationCS156: The Calculus of Computation
Page 1 of 61 CS156: The Calculus of Computation Zohar Manna Winter 2010 Chapter 5: Program Correctness: Mechanics Page 2 of 61 Program A: LinearSearch with function specification @pre 0 l u < a @post rv
More informationEDA045F: Program Analysis LECTURE 10: TYPES 1. Christoph Reichenbach
EDA045F: Program Analysis LECTURE 10: TYPES 1 Christoph Reichenbach In the last lecture... Performance Counters Challenges in Dynamic Performance Analysis Taint Analysis Binary Instrumentation 2 / 44 Types
More informationUnifying Theories of Programming
1&2 Unifying Theories of Programming Unifying Theories of Programming 3&4 Theories Unifying Theories of Programming designs predicates relations reactive CSP processes Jim Woodcock University of York May
More informationProgramming Languages
CSE 230: Winter 2008 Principles of Programming Languages Lecture 6: Axiomatic Semantics Deriv. Rules for Hoare Logic `{A} c {B} Rules for each language construct ` {A} c 1 {B} ` {B} c 2 {C} ` {A} skip
More informationLecture 2: Axiomatic semantics
Chair of Software Engineering Trusted Components Prof. Dr. Bertrand Meyer Lecture 2: Axiomatic semantics Reading assignment for next week Ariane paper and response (see course page) Axiomatic semantics
More informationVerification of Recursive Programs. Andreas Podelski February 8, 2012
Verification of Recursive Programs Andreas Podelski February 8, 2012 1 m(x) = x 10 if x > 100 m(m(x + 11)) if x 100 2 procedure m(x) returns (res) `0: if x>100 `1: res:=x-10 else `2: x m := x+11 `3: res
More informationToday s Lecture. Lecture 4: Formal SE. Some Important Points. Formal Software Engineering. Introduction to Formal Software Engineering
Today s Lecture Lecture 4: Formal SE Introduction to Formal Software Engineering Discuss Models Discuss Formal Notations Kenneth M. Anderson Foundations of Software Engineering CSCI 5828 - Spring Semester,
More informationSoftwaretechnik. Lecture 13: Design by Contract. Peter Thiemann University of Freiburg, Germany
Softwaretechnik Lecture 13: Design by Contract Peter Thiemann University of Freiburg, Germany 25.06.2012 Table of Contents Design by Contract Contracts for Procedural Programs Contracts for Object-Oriented
More informationTowards Mechanical Derivation of Krylov Solver Libraries
Towards Mechanical Derivation of Krylov Solver Libraries Victor Eijkhout Texas Advanced Computing Center with Paolo Bientinesi and Robert van de Geijn support: National Science Foundation award #0917096
More informationSoftwaretechnik. Lecture 13: Design by Contract. Peter Thiemann University of Freiburg, Germany
Softwaretechnik Lecture 13: Design by Contract Peter Thiemann University of Freiburg, Germany 25.06.2012 Table of Contents Design by Contract Contracts for Procedural Programs Contracts for Object-Oriented
More information(La méthode Event-B) Proof. Thanks to Jean-Raymond Abrial. Language of Predicates.
CSC 4504 : Langages formels et applications (La méthode Event-B) J Paul Gibson, A207 paul.gibson@it-sudparis.eu http://www-public.it-sudparis.eu/~gibson/teaching/event-b/ Proof http://www-public.it-sudparis.eu/~gibson/teaching/event-b/proof.pdf
More informationLoop Convergence. CS 536: Science of Programming, Fall 2018
Solved Loop Convergence CS 536: Science of Programming, Fall 2018 A. Why Diverging programs aren t useful, so it s useful to know how to show that loops terminate. B. Objectives At the end of this lecture
More informationDesign of Distributed Systems Melinda Tóth, Zoltán Horváth
Design of Distributed Systems Melinda Tóth, Zoltán Horváth Design of Distributed Systems Melinda Tóth, Zoltán Horváth Publication date 2014 Copyright 2014 Melinda Tóth, Zoltán Horváth Supported by TÁMOP-412A/1-11/1-2011-0052
More informationAxiomatic semantics. Semantics and Application to Program Verification. Antoine Miné. École normale supérieure, Paris year
Axiomatic semantics Semantics and Application to Program Verification Antoine Miné École normale supérieure, Paris year 2015 2016 Course 6 18 March 2016 Course 6 Axiomatic semantics Antoine Miné p. 1 /
More informationLecture 17: Floyd-Hoare Logic for Partial Correctness
Lecture 17: Floyd-Hoare Logic for Partial Correctness Aims: To look at the following inference rules Page 1 of 9 sequence; assignment and consequence. 17.1. The Deduction System for Partial Correctness
More informationGalois Connections. Roland Backhouse 3rd December, 2002
1 Galois Connections Roland Backhouse 3rd December, 2002 Fusion 2 Many problems are expressed in the form evaluate generate where generate generates a (possibly infinite) candidate set of solutions, and
More informationCalculating axiomatic semantics from program equations by means of functional predicate calculus
Calculating axiomatic semantics from program equations by means of functional predicate calculus (Some initial results of recent work not for dissemination) Raymond Boute INTEC Ghent University 2004/02
More informationSoftware Verification 1 Deductive Verification
Software Verification 1 Deductive Verification Prof. Dr. Holger Schlingloff Institut für Informatik der Humboldt Universität und Fraunhofer Institut für offene Kommunikationssysteme FOKUS 21.5.2015 Folie
More informationSOME SMALL EXAMPLES OF FORMAL VERIFICATION
SOME SMALL EXAMPLES OF FORMAL VERIFICATION Assertion: A logical expression inolving program variables which should be true when control "passes through" the assertion. Assertions in this sense are not
More informationDecision Procedures. Jochen Hoenicke. Software Engineering Albert-Ludwigs-University Freiburg. Winter Term 2016/17
Decision Procedures Jochen Hoenicke Software Engineering Albert-Ludwigs-University Freiburg Winter Term 2016/17 Jochen Hoenicke (Software Engineering) Decision Procedures Winter Term 2016/17 1 / 436 Program
More informationTop Down Design. Gunnar Gotshalks 03-1
Top Down Design 03-1 Top Down Description Top down is also known as step wise refinement and functional decomposition Given an operation, there are only the following three choices for refinement» Sequence
More information5. Program Correctness: Mechanics
5. Program Correctness: Mechanics Program A: LinearSearch with function specification @pre 0 l u < a @post rv i. l i u a[i] = e bool LinearSearch(int[] a, int l, int u, int e) { for @ (int i := l; i u;
More informationProbabilistic Guarded Commands Mechanized in HOL
Probabilistic Guarded Commands Mechanized in HOL Joe Hurd joe.hurd@comlab.ox.ac.uk Oxford University Joint work with Annabelle McIver (Macquarie University) and Carroll Morgan (University of New South
More informationProving Inter-Program Properties
Unité Mixte de Recherche 5104 CNRS - INPG - UJF Centre Equation 2, avenue de VIGNATE F-38610 GIERES tel : +33 456 52 03 40 fax : +33 456 52 03 50 http://www-verimag.imag.fr Proving Inter-Program Properties
More informationINVARIANT RELATIONS: A CONCEPT FOR ANALYZING WHILE LOOPS. Ali Mili, NJIT NII, Tokyo, Japan December 20, 2011
INVARIANT RELATIONS: A CONCEPT FOR ANALYZING WHILE LOOPS Ali Mili, NJIT NII, Tokyo, Japan December 20, 2011 PLAN 2 Motivation Relational Mathematics Invariant Relations Invariant Relations and Loop Functions
More informationA Humble Introduction to DIJKSTRA S A A DISCIPLINE OF PROGRAMMING
A Humble Introduction to DIJKSTRA S A A DISCIPLINE OF PROGRAMMING Do-Hyung Kim School of Computer Science and Engineering Sungshin Women s s University CONTENTS Bibliographic Information and Organization
More informationTHE AUSTRALIAN NATIONAL UNIVERSITY Second Semester COMP2600 (Formal Methods in Software Engineering)
THE AUSTRALIAN NATIONAL UNIVERSITY Second Semester 2007 COMP2600 (Formal Methods in Software Engineering) Writing Period: 3 hours duration Study Period: 15 minutes duration Permitted Materials: None Answer
More informationAsynchronous Communication 2
Asynchronous Communication 2 INF4140 22.11.12 Lecture 11 INF4140 (22.11.12) Asynchronous Communication 2 Lecture 11 1 / 37 Overview: Last time semantics: histories and trace sets specification: invariants
More informationHoare Examples & Proof Theory. COS 441 Slides 11
Hoare Examples & Proof Theory COS 441 Slides 11 The last several lectures: Agenda Denotational semantics of formulae in Haskell Reasoning using Hoare Logic This lecture: Exercises A further introduction
More informationUnderstanding Process Semantics
TU München March, 2017 Understanding Process Semantics David de Frutos Escrig In collaboration with: Carlos Gregorio Rodríguez, Miguel Palomino and Ignacio Fábregas Departamento de Sistemas Informáticos
More informationIntroduction to Axiomatic Semantics
Introduction to Axiomatic Semantics Meeting 9, CSCI 5535, Spring 2009 Announcements Homework 3 is out, due Mon Feb 16 No domain theory! Homework 1 is graded Feedback attached 14.2 (mean), 13 (median),
More information