Unifying Theories of Programming

Size: px
Start display at page:

Download "Unifying Theories of Programming"

Transcription

1 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 2006 Unifying Theories of Programming C. A. R. Hoare & He Jifeng, Prentice Hall, 1998 alphabetised relations as unifying basis for programming linking many different computational paradigms relations between initial and intermediate or final observation

2 5&6 Unifying Theories of Programming Unifying Theories of Programming 7&8 Alphabetised Relational Calculus 1. Observations Theories alphabet: external observations of behaviour signature: syntax for denoting objects of theory healthiness conditions: identify interesting sub-theories programs designs specifications Jim Woodcock University of York May Introduction 1. observations 2. the alphabetised relatinal calculus 3. the complete lattice 4. specifications Observable variabes alphabet: variables describe relevant aspects of behaviour observations: relation between initial and after values external variables: globally shared with real world clock, l, okay, ref, resource, tr, wait,

3 9&10 Unifying Theories of Programming Unifying Theories of Programming 11&12 2. The alphabetised relational calculus Terminology Healthiness conditions feasible descriptions of reality increase towards code P = φ(p), for idempotent φ links to translate designs into implementations an alphabet is a set of observation names okay, trace, wait, ref, l, a relation P, Q,...,true is an alphabet-predicate pair freevars(p) αp αp = inαp outαp homogeneous: outαp = inαp condition: b, c, d,...,true outα b = similar to Z s schema calculus much simpler: untyped Examples time travel 1 B = clock clock tr prefix tr P B (P = P B) for all programs P time travel 2 T = okay T P (P = T P) for all programs P proper initialisation and finalisation J = J ; J and K = K ; K Conjunction P Q x satisfies P Q iff x satisfies P and x satisfies Q α(p Q ) = αp αq (x := x + z y := y w) = (x = x + z y = y w) = (x, y := x + z, y w) P(x, y) Q (y, z) P = J ; P and P = P ; K for all programs P

4 13&14 Unifying Theories of Programming Unifying Theories of Programming 15&16 Correctness [ P ]: universal closure of P S P iff [ P S ] example: specification x > x y = y implementation x, y := x + 1, y correctness [ x, y := x + 1, y x > x y = y ] = [ x = x + 1 y = y x > x y = y ] = true L1 P b P = P idempotence L2 P b Q = Q b P symmetry L3 (P b Q ) c R = P b c (Q c R) associativity L4 P b (Q c R) = (P b Q ) c (P b R) distrib. L5 P true Q = P = Q false P unit L6 P b (Q b R) = P b R L7 P b (P c Q ) = P b c Q L8 (P Q ) b (R S) = (P b R) (Q b S) exchange L9 (P b Q ) = ( P b Q ) not-conditional L10 (P b Q ) (R b S) = (P R) b (Q S) [conditional-and-not-conditional] L11 L12 (P (Q b R)) = ((P Q ) b (P R)) implies-cond.-1 ((P b Q ) R) = ((P R) b (Q R)) implies-cond.-2 Conditional P b Q = (b P) ( b Q ) if αb αp = αq α(p b Q ) = αp L13 (P b Q ) R = (P R) b (Q R) cond.-conjunction L14 (P b Q ) R = (P R) b (Q R) cond.-disjunction L15 b (P b Q ) = (b P) left-simplification-1 L16 b (P b Q ) = ( b Q ) right-simplification-2 L17 (P b Q ) = ((b P) b Q ) left-condition L18 (P b Q ) = (P b ( b Q )) right-condition

5 17&18 Unifying Theories of Programming Unifying Theories of Programming 19&20 Proof of L6 (P b (Q b R)) = ((Q b R) b P) [by L2] = (Q b b (R b P)) [by L3] = (Q false (R b P)) [by propositional calculus] = (R b P) [by L5] = (P b R) [by L2] Refinement to conditional P (Q b R) = [(Q b R) P ] = [ b Q b R P ] = [ b Q P ] [ b R P ] = ( P b Q ) ( P b R ) Proof of L7 (P b (P c Q )) = ((Q c P) b P [by L2] = (Q c b (P b P)) [by L3] = (Q c b P) [by L1] = (P b c Q ) [by L2] Separation of requirements ((P Q ) R) = (P R) (Q R)

6 21&22 Unifying Theories of Programming Unifying Theories of Programming 23&24 Composition P(v ) ; Q (v) = v 0 P(v 0 ) Q (v 0 ) if outαp = inαq ={v } inα(p(v ) ; Q (v)) = inαp outα(p(v ) ; Q (v)) = outαq L1 P ; (Q ; R) = (P ; Q ) ; R associativity L2 (P b Q ) ; R = ((P ; R) b (Q ; R)) left distribution Laws of assignment L1 (x := e) = (x, y := e, y) L2 (x, y, z := e, f, g) = (y, x, z := f, e, g) L3 (x := e ; x := f (x)) = (x := f (e)) L4 (x := e ; (P b(x) Q )) = ((x := e ; P) b(e) (x := e ; Q )) L5 P ; I αp = P = I αp ; P unit L6 v = e ; P = P[e/v] where αp ={v, v } left-one-point L7 P ; v = e = P[e/v ] where αp ={v, v } right-one-point Assignment for A ={x, y,...,z, x, y,...,z } and αe in(a) x := A e = (x = e y = y z = z) α(x := A e) = A I A = (v = v) if A ={v, v } αi A = A Array assignment array-valued variables assignment to ith element: w[i] := e w := w {i e} w x = (x i dom x w)

7 25&26 Unifying Theories of Programming Unifying Theories of Programming 27&28 Nondeterminism P Q = P Q if αp = αq α(p Q ) = αp L1 P Q = Q P symmetry L2 P (Q R) = (P Q ) R associativity L3 P P = P idempotence L4 P (Q R) = (P Q ) (P R) distributivity L5 (P b (Q R)) = (P b Q ) (P b R) distributivity L6 (P Q ) ; R = (P ; R) (Q ; R) distributivity L7 P ; (Q R) = (P ; Q ) (P ; R) distributivity L8 P (Q b R) = ((P Q ) b (P R)) distributivity Monotonicity F is monotonic iff P Q F (P) F (Q ) disjunctive operators are always monotonic suppose that P P and is disjunctive P Q P Q = ((P Q ) (P Q ) = P Q ) = ((P P ) Q = P Q ) monotonic operators aren t always disjunctive P 2 = P ; P (Q R) 2 = Q 2 R 2 (Q ; R) (R ; Q ) Q 2 R 2 Refinement and nondeterminism P Q = P = (P Q P) (P P Q ) = [ P P Q ] [ P Q P ] = [ P P Q ] [ P Q P ] = true [ P Q P ] = [ Q P ] = P Q Conjunction P Q = P Q α(p Q ) = αp αq

8 29&30 Unifying Theories of Programming Unifying Theories of Programming 31&32 Example of complete lattice natural numbers ordered by divisibility 3. The complete lattice Definition: Complete lattice A lattice is a partially ordered set, in which all non-empty finite subsets have both a least upper-bound (join) and a greatest lower bound (meet). A complete lattice is a lattice in which all subsets have both a join and a meet. partial order m n ( k k m = n ) 1 is bottom (exactly divides every other number) 0 is top (it can be divided exactly by every other number) join of finite sets is least common multiple join of infinite sets is 0 meet is greatest common divisor for infinite sets gcd be greater than 1 example: set of all even numbers has 2 as gcd Abort and miracle Example of complete lattice power set of S ordered by inclusion. empty set is least element S is greatest element A α A A α A = true = A = false = A union is join intersection is meet for all P with alphabet A L1 [ P A ] L2 [ A P ]

9 33&34 Unifying Theories of Programming Unifying Theories of Programming 35&36 Recursion Laws of the lattice L1 [ P S ] iff ([P X ] for all X in S ) L1A [ S X ] for all X in S L1B if [ P X ] for all X in S, then [ P S ] L2 ( S ) Q = { P Q P S } L3 ( S ) Q = { P Q P S } L4 ( S ) ; Q = { P ; Q P S } L5 R ; ( S ) = { R ; P P S } weakest fixed-point μ F = { X [ X F (X )]} μ X C(X ) = μ F where F = λ X C(X ) μ X X = true L1 [ Y μ F ] if [ Y F (Y )] weakest fixed-point L2 [ F (μ F ) = μ F ] fixed-point strongest fixed-point is dual of wfp Recursion: weakest fixed-point alphabetised relations form a complete lattice all operators are monotonic every construction is monotonic Tarski: complete lattice of fixed-points is strongest fixed-point of X = P ; X is weakest fixed-point Proof of L1 F (Y ) Y = Y {X F (X ) X } [by comprehension] { X F (X ) X } Y [by L1A] = μ F Y [by definition of μ F ] so μ F is weaker than any other fixed-point of F

10 37&38 Unifying Theories of Programming Unifying Theories of Programming 39&40 Proof of L2 μ F = F (μ F ) [mutual refinement] = μ F F (μ F ) F (μ F ) μ F [fixed-point L1] F (F (μ F )) F (μ F ) F (μ F ) μ F [F monotonic] F (μ F ) μ F [definition] = F (μ F ) { X F (X ) X } [lattice L1B] X {X F (X ) X } F(μ f ) X [comprehension] = X F (X ) X F (μ F ) X [transitivity of ] X F (X ) X F (μ F ) F (X ) [F monotonic] X F (X ) X μ F X [fixed-point L1] = true Iteration b P = μ X ((P ; X ) b I ) copy rule Bottom { X true }= { X true } = { X true } { X true } = { X true } = [ { X true } ] = [ true { X true } ] = [ { X true } ] = [ X true ] = true Nontermination what s the weakest fixed-point of X = X? μ X X = { Y (λ X X )(Y ) Y } = { Y Y Y } = { Y true } = consequence (for sole state variable x and constant c): ( ; x := c ) = ( x := c )

11 41&42 Unifying Theories of Programming Unifying Theories of Programming 43&44 Recursion: strongest fixed-point dual of the weakest fixed-point νf = μ X F( X ) L1 [νf S ] if [ F (S) S ] strongest fixed-point L2 [ F (νf ) = νf ] fixed-point Conditional termination suppose F terminates whenever C holds [ C μ F = C νf ] fixed-points appear equal within window C L3 false ; P = false = P ; false good enough if specification is C S ν is easier to work with than μ Nontermination strongest fixed-point inappropriate (νx X ) = false = S, for all S consequence: P = P Weakest fixed-point lemma if [ F (C S) (C S)] and [ C (μ F = νf )] then [μf (C S)] pity, since it s the best to reason with any recursion with guaranteed termination single fixed-point: μ F = νf

12 45&46 Unifying Theories of Programming Unifying Theories of Programming 47&48 4. Specifications Hoare logic Hoare logic (also known as Floyd-Hoare logic) is a formal system developed by the British computer scientist C. A. R. Hoare, and subsequently refined by Hoare and other researchers. It was published in Hoare s 1969 paper An axiomatic basis for computer programming. The purpose of the system is to provide a set of logical rules in order to reason about the correctness of computer programs with the rigour of mathematical logic. Hoare logic has axioms and inference rules for all the constructs of a simple imperative programming language. In addition to the rules for the simple language in Hoare s original paper, rules for other language constructs have been developed since then by Hoare and many other researchers. There are rules for concurrency, procedures, jumps, and pointers. Hoare acknowledges earlier contributions from Robert Floyd, who had published a similar system for flowcharts. The central feature of Hoare logic is the Hoare triple. A triple describes how the execution of a piece of code changes the state of the computation. A Hoare triple is of the form p {Q } r where p and r are assertions and Q is a command. The assertion p is called the precondition and r the postcondition. Assertions are formulas in predicate logic. The intuitive reading of such a triple is: Whenever p holds of the state before the execution of Q, then r will hold afterwards. Note that if Q does not terminate, then there is no after, so r can be any statement at all. Indeed, one can choose r to be false to express that Q does not terminate. This is called partial correctness. If C terminates and at termination Q is true, the expression exhibits "total correctness". Termination would have to be proved separately. p {Q } r = [ Q (p r )] = (p r ) Q L1 if p {Q } r and p {Q } s then p {Q } (r s) L2 if p {Q } r and q {Q } r then (p q) {Q } r L3 if p {Q } r then (p q) {Q } (r s) L4 r(e) {x := e} r(x) L5 if (p b) {Q 1 } r and (p b) {Q 2 } r then p { Q 1 b Q 2 } r L6 if p {Q 1 } s and s {Q 2 } r then p { Q 1 ; Q 2 } r L7 if p {Q 1 } r and p {Q 2 } r then p { Q 1 Q 2 } r L8 if (b c) {Q } c then c { νx (Q ; X ) b I } ( b c) L9 false {Q } r and p {Q } true and p {false} false and p {I } p

13 49&50 Unifying Theories of Programming Unifying Theories of Programming 51&52 Proof of L1 (p {Q } r) (p {Q } s) = (Q (p r )) (Q (p s )) = (Q (p r ) (p s )) = (Q (p r s )) Assumptions and assertions c = I c [assumption] c = I c [assertion] = p {Q } (r s) Proof of L8 suppose that (b c) {Q } c define Y = c b c c { νx (Q ; X ) b I } ( b c) = Y νx (Q ; X ) b I [by definition] Y (Q ; Y ) b I [by sfp L1] = ( Y (b Q ) ; Y ) ( Y b I ) [refinement to cond] = ( Y (b Q ) ; Y ) [ b I (c b c )] [by def] = ( Y (b Q ) ; Y ) true predicate calculus = c { b Q ; Y } ( b c) [by definition] ( c { b Q } c ) ( c { c b c } b c ) [by Hoare L6] = true [by assumption and predicate calculus] Example b ; c = (I b ) ; c [by definition of b ] = ((I ; c ) b ( ; c )) [by -;-left distribution] = (c b ( ; c )) [by assignment.l5] = (c b ) [from above] = ((I c ) b ) [by definition of c ] = (I b c ) [by conditional.l3] = (b c) [by definition of (b c) ]

14 53&54 Unifying Theories of Programming Unifying Theories of Programming 55&56 Extreme solution p(v) { Q (v, v ) } r(v) = [ Q (v, v ) ( p(v) r(v ))] Examples b ; (P b Q ) = b ; P b ; (P b Q ) = b ; P = [ p(v) ( Q (v, v ) r(v ))] = [ p(v) ( v Q (v, v ) r(v ))] = [ p(v) ( v Q (v, v ) r(v ))] = [ p(v) ( v 0 Q (v, v 0 ) r(v 0 ))] = [ p(v) ( Q (v, v ) ; r(v)) ] if W (v) = ( Q (v, v ) ; r(v)) then W (v) { Q (v, v ) } r(v) W is the weakest solution for the precondition for Q to be guaranteed to achieve r wp calculus Q wp r = (Q ; r) Example b ; true ; c = b ; c b ; true ; c L1 ((x := e) wp r(x)) = r(e) L2 ((P ; Q ) wp r) = (P wp (Q wp r)) L3 ((P b Q ) wp r) = ((P wp r) b (Q wp r)) L4 ((P Q ) wp r) = (P wp r) (Q wp r) L5 if [ r s ] then [(Q wp r) (Q wp s)] L6 if [ Q S ] then [(S wp r) (Q wp r)] L7 (Q wp ( R)) = { (Q wp r) r R } L8 (Q wp false) = false if Q ; true = true L9 [(P ; Q ) S ] iff [ P (Q wp S)] weakest prespecification

15 57&58 Unifying Theories of Programming Unifying Theories of Programming 59&60 Variable declarations let A be an alphabet containing x and x var x = ( x I A ) end x = ( x I A ) α( var x ) = A \{x} α( end x ) = A \{x } Example ((var x ) wp r ) = (( x I ) wp r ) [by definition of var x] = (( x I ) ; r ) [by definition of wp] = ( x I ; r ) [relational calculus] = ( x r ) [by assignment.l5] = ( x r ) [by De Morgan s Law] ( var x ; Q ) = ( x Q ) ( Q ; end x ) = ( x Q ) Laws of declaration L1 ( var x ; var y ) = ( var y ; var x ) = ( var x, y ) L2 ( end x ; end y ) = ( end y ; end x ) = ( end x, y ) L3 ( var x ; end y ) = ( end y ; var x ) x, y distinct L4 ( var x ) = { ( var x := k ) k T } L5 ( var x ; ( P b Q ) = ((var x ; P ) b (var x ; Q )) no x in b L6 ( end x ; ( P b Q ) = ((end x ; P ) b (end x ; Q )) no x in b L7 ( var x ; end x ) = I L8 ( end x ; var x := e ) = ( x := e ) L9 ( x := e ; end x ) = ( end x ) Alphabet extension alphabet restriction: var x ; Q ; end x alphabet extension: R +x = R x = x for x, x αr α(r +x ) = αr {x, x } if R doesn t mention x, then L10 var x ; R +x ; P ; end x = R ; var x ; P ; end x L11 var x ; P ; R +x ; end x = var x ; P ; end x ; R

16 61&62 Unifying Theories of Programming A model for ARC P = x = on αp = {x, y} P ={{x on, y on}, {x on, y off}} sets of functions, each total over the alphabet formalised as deep embedding in Z/Eves and ProofPowerZ Types adding a simple type system to ARC Type ::= basic Name power Type product Type labelled Type suppose that τ : αp Type for αp = x,...,z Z = x τ(x) z τ(z) P is well typed: P = P Z

A Tutorial Introduction to CSP in Unifying Theories of Programming

A Tutorial Introduction to CSP in Unifying Theories of Programming A Tutorial Introduction to CSP in Unifying Theories of Programming Ana Cavalcanti and Jim Woodcock Department of Computer Science University of York Heslington, York YO10 5DD, UK {Ana.Cavalcanti,Jim.Woodcock}@cs.york.ac.uk

More information

UTP by Example: Designs

UTP by Example: Designs UTP by Example: Designs Jim Woodcock (B) and Simon Foster University of York, York, UK jim.woodcock@york.ac.uk Abstract. We present a tutorial introduction to the semantics of a basic nondeterministic

More information

Circus Time with Reactive Designs

Circus Time with Reactive Designs Circus Time with Reactive Designs Kun Wei, Jim Woodcock, and Ana Cavalcanti Department of Computer Science, University of York, York, YO10 5GH, UK {kun.wei,jim.woodcock,ana.cavalcanti}@york.ac.uk Abstract.

More information

A Timed Model of Circus with the Reactive Design Miracle

A Timed Model of Circus with the Reactive Design Miracle Introduction A Timed Model of Circus with the Reactive Design Miracle Computer Science, University of York 20 Jan 2009 Introduction Alphabetised relational calculus The semantics of UTP Reactive designs

More information

Denotational Semantics of Mobility in Unifying Theories of Programming (UTP)

Denotational Semantics of Mobility in Unifying Theories of Programming (UTP) Denotational Semantics of Mobility in Unifying Theories of Programming (UTP) Gerard Ekembe Ngondi University of York Computer Science November 2016 Abstract UTP promotes the unification of programming

More information

Hoare Calculus and Predicate Transformers

Hoare 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 information

Algebraic Reasoning for Probabilistic Action Systems and While-Loops

Algebraic Reasoning for Probabilistic Action Systems and While-Loops Algebraic Reasoning for Probabilistic Action Systems and While-Loops Larissa Meinicke Ian J. Hayes September 006 Technical Report SSE-006-05 Division of Systems and Software Engineering Research School

More information

HRML: a hybrid relational modelling language. He Jifeng

HRML: a hybrid relational modelling language. He Jifeng HRML: a hybrid relational modelling language He Jifeng Hybrid Systems Systems are composed by continuous physical component and discrete control component The system state evoles over time according to

More information

Mechanising the Alphabetised Relational Calculus

Mechanising the Alphabetised Relational Calculus Electronic Notes in Theoretical Computer Science 95 (2004) 209 225 www.elsevier.com/locate/entcs Mechanising the Alphabetised Relational Calculus Gift Nuka 1 Jim Woodcock 2 Computing Laboratory University

More information

Programming Languages and Compilers (CS 421)

Programming 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 information

Lecture 2: Axiomatic semantics

Lecture 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 information

AN INTRODUCTION TO SEPARATION LOGIC. 2. Assertions

AN INTRODUCTION TO SEPARATION LOGIC. 2. Assertions AN INTRODUCTION TO SEPARATION LOGIC 2. Assertions John C. Reynolds Carnegie Mellon University January 7, 2011 c 2011 John C. Reynolds Pure Assertions An assertion p is pure iff, for all stores s and all

More information

Chapter 2. Assertions. An Introduction to Separation Logic c 2011 John C. Reynolds February 3, 2011

Chapter 2. Assertions. An Introduction to Separation Logic c 2011 John C. Reynolds February 3, 2011 Chapter 2 An Introduction to Separation Logic c 2011 John C. Reynolds February 3, 2011 Assertions In this chapter, we give a more detailed exposition of the assertions of separation logic: their meaning,

More information

Marie Farrell Supervisors: Dr Rosemary Monahan & Dr James Power Principles of Programming Research Group

Marie 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 information

Deductive Verification

Deductive 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 information

Program verification. 18 October 2017

Program 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 information

Hoare Logic: Part II

Hoare 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 information

Hoare Logic: Reasoning About Imperative Programs

Hoare 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 information

Mid-Semester Quiz Second Semester, 2012

Mid-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 information

Proof Calculus for Partial Correctness

Proof 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 information

First Order Logic vs Propositional Logic CS477 Formal Software Dev Methods

First 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 information

Design 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 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 information

Axiomatic Semantics. Lecture 9 CS 565 2/12/08

Axiomatic 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 information

Dynamic Semantics. Dynamic Semantics. Operational Semantics Axiomatic Semantics Denotational Semantic. Operational Semantics

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 information

What 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 )

What 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 information

Program verification. Hoare triples. Assertional semantics (cont) Example: Semantics of assignment. Assertional semantics of a program

Program 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 information

Axiomatic Semantics. Hoare s Correctness Triplets Dijkstra s Predicate Transformers

Axiomatic 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 information

Weakest Precondition Calculus

Weakest 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 information

Propositional Logic Language

Propositional Logic Language Propositional Logic Language A logic consists of: an alphabet A, a language L, i.e., a set of formulas, and a binary relation = between a set of formulas and a formula. An alphabet A consists of a finite

More information

Coinductive big-step semantics and Hoare logics for nontermination

Coinductive big-step semantics and Hoare logics for nontermination Coinductive big-step semantics and Hoare logics for nontermination Tarmo Uustalu, Inst of Cybernetics, Tallinn joint work with Keiko Nakata COST Rich Models Toolkit meeting, Madrid, 17 18 October 2013

More information

Linking Duration Calculus and TLA

Linking Duration Calculus and TLA Linking Duration Calculus and TLA Yifeng Chen and Zhiming Liu Department of Computer Science, University of Leicester, Leicester LE1 7RH, UK Email: {Y.Chen, Z.Liu}@mcs.le.ac.uk Abstract. Different temporal

More information

COMP2111 Glossary. Kai Engelhardt. Contents. 1 Symbols. 1 Symbols 1. 2 Hoare Logic 3. 3 Refinement Calculus 5. rational numbers Q, real numbers R.

COMP2111 Glossary. Kai Engelhardt. Contents. 1 Symbols. 1 Symbols 1. 2 Hoare Logic 3. 3 Refinement Calculus 5. rational numbers Q, real numbers R. COMP2111 Glossary Kai Engelhardt Revision: 1.3, May 18, 2018 Contents 1 Symbols 1 2 Hoare Logic 3 3 Refinement Calculus 5 1 Symbols Booleans B = {false, true}, natural numbers N = {0, 1, 2,...}, integers

More information

COP4020 Programming Languages. Introduction to Axiomatic Semantics Prof. Robert van Engelen

COP4020 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 information

Mechanical Reasoning about Families of UTP Theories

Mechanical Reasoning about Families of UTP Theories Electronic Notes in Theoretical Computer Science 240 (2009) 239 257 www.elsevier.com/locate/entcs Mechanical Reasoning about Families of UTP Theories Frank Zeyda 1 and Ana Cavalcanti 2 Department of Computer

More information

Spring 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 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 information

Classical Program Logics: Hoare Logic, Weakest Liberal Preconditions

Classical 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 information

A Short Introduction to Hoare Logic

A 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 information

Bilateral Proofs of Safety and Progress Properties of Concurrent Programs (Working Draft)

Bilateral 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 information

Spring 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 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 information

Hoare Logic (I): Axiomatic Semantics and Program Correctness

Hoare 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 information

Calculating axiomatic semantics from program equations by means of functional predicate calculus

Calculating 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 information

CS558 Programming Languages

CS558 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 information

This is a repository copy of Towards Verification of Cyber-Physical Systems with UTP and Isabelle/HOL.

This is a repository copy of Towards Verification of Cyber-Physical Systems with UTP and Isabelle/HOL. This is a repository copy of Towards Verification of Cyber-Physical Systems with UTP and Isabelle/HOL. White Rose Research Online URL for this paper: http://eprints.whiterose.ac.uk/110313/ Version: Accepted

More information

THE AUSTRALIAN NATIONAL UNIVERSITY Second Semester COMP2600/COMP6260 (Formal Methods for Software Engineering)

THE 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 information

Universität Augsburg

Universität Augsburg Universität Augsburg Algebraic Separation Logic H.-H. Dang P. Höfner B. Möller Report 2010-06 July 2010 Institut für Informatik D-86135 Augsburg Copyright c H.-H. Dang P. Höfner B. Möller Institut für

More information

Floyd-Hoare Style Program Verification

Floyd-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 information

Axiomatic 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 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 information

CS 6110 Lecture 21 The Fixed-Point Theorem 8 March 2013 Lecturer: Andrew Myers. 1 Complete partial orders (CPOs) 2 Least fixed points of functions

CS 6110 Lecture 21 The Fixed-Point Theorem 8 March 2013 Lecturer: Andrew Myers. 1 Complete partial orders (CPOs) 2 Least fixed points of functions CS 6110 Lecture 21 The Fixed-Point Theorem 8 March 2013 Lecturer: Andrew Myers We saw that the semantics of the while command are a fixed point. We also saw that intuitively, the semantics are the limit

More information

Hoare Logic: Reasoning About Imperative Programs

Hoare 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 information

The Journal of Logic and Algebraic Programming

The Journal of Logic and Algebraic Programming The Journal of Logic and Algebraic Programming 79 (2010) 144 173 Contents lists available at ScienceDirect The Journal of Logic and Algebraic Programming journal homepage: www.elsevier.com/locate/jlap

More information

Proof Theoretical Studies on Semilattice Relevant Logics

Proof Theoretical Studies on Semilattice Relevant Logics Proof Theoretical Studies on Semilattice Relevant Logics Ryo Kashima Department of Mathematical and Computing Sciences Tokyo Institute of Technology Ookayama, Meguro, Tokyo 152-8552, Japan. e-mail: kashima@is.titech.ac.jp

More information

Hoare 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. 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 information

The non-logical symbols determine a specific F OL language and consists of the following sets. Σ = {Σ n } n<ω

The non-logical symbols determine a specific F OL language and consists of the following sets. Σ = {Σ n } n<ω 1 Preliminaries In this chapter we first give a summary of the basic notations, terminology and results which will be used in this thesis. The treatment here is reduced to a list of definitions. For the

More information

MODELING NONDETERMINISM IN PROGRAM SEMANTICS USING LIFTED BINARY MULTIRELATIONS

MODELING NONDETERMINISM IN PROGRAM SEMANTICS USING LIFTED BINARY MULTIRELATIONS MODELING NONDETERMINISM IN PROGRAM SEMANTICS USING LIFTED BINARY MULTIRELATIONS A thesis submitted to Kent State University in partial fulfillment of the requirements for the degree of Master of Science

More information

Proofs of Correctness: Introduction to Axiomatic Verification

Proofs 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 information

Gerwin Klein, June Andronick, Ramana Kumar S2/2016

Gerwin Klein, June Andronick, Ramana Kumar S2/2016 COMP4161: Advanced Topics in Software Verification {} Gerwin Klein, June Andronick, Ramana Kumar S2/2016 data61.csiro.au Content Intro & motivation, getting started [1] Foundations & Principles Lambda

More information

Přednáška 12. Důkazové kalkuly Kalkul Hilbertova typu. 11/29/2006 Hilbertův kalkul 1

Přednáška 12. Důkazové kalkuly Kalkul Hilbertova typu. 11/29/2006 Hilbertův kalkul 1 Přednáška 12 Důkazové kalkuly Kalkul Hilbertova typu 11/29/2006 Hilbertův kalkul 1 Formal systems, Proof calculi A proof calculus (of a theory) is given by: A. a language B. a set of axioms C. a set of

More information

CSC 7101: Programming Language Structures 1. Axiomatic Semantics. Stansifer Ch 2.4, Ch. 9 Winskel Ch.6 Slonneger and Kurtz Ch. 11.

CSC 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 information

Views: Compositional Reasoning for Concurrent Programs

Views: Compositional Reasoning for Concurrent Programs Views: Compositional Reasoning for Concurrent Programs Thomas Dinsdale-Young Imperial College td202@doc.ic.ac.uk Lars Birkedal IT University of Copenhagen birkedal@itu.dk Philippa Gardner Imperial College

More information

Reasoning About Imperative Programs. COS 441 Slides 10b

Reasoning 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 information

Lecture Notes on Software Model Checking

Lecture Notes on Software Model Checking 15-414: Bug Catching: Automated Program Verification Lecture Notes on Software Model Checking Matt Fredrikson André Platzer Carnegie Mellon University Lecture 19 1 Introduction So far we ve focused on

More information

Formal Methods for Probabilistic Systems

Formal Methods for Probabilistic Systems Formal Methods for Probabilistic Systems Annabelle McIver Carroll Morgan Source-level program logic Meta-theorems for loops Examples Relational operational model Standard, deterministic, terminating...

More information

Exercises 1 - Solutions

Exercises 1 - Solutions Exercises 1 - Solutions SAV 2013 1 PL validity For each of the following propositional logic formulae determine whether it is valid or not. If it is valid prove it, otherwise give a counterexample. Note

More information

Lecture Notes: Axiomatic Semantics and Hoare-style Verification

Lecture 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 information

The Assignment Axiom (Hoare)

The 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 information

Axiomatic Semantics: Verification Conditions. Review of Soundness and Completeness of Axiomatic Semantics. Announcements

Axiomatic 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 information

Last Time. Inference Rules

Last 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 information

Temporal Logic Model Checking

Temporal Logic Model Checking 18 Feb, 2009 Thomas Wahl, Oxford University Temporal Logic Model Checking 1 Temporal Logic Model Checking Thomas Wahl Computing Laboratory, Oxford University 18 Feb, 2009 Thomas Wahl, Oxford University

More information

Course Runtime Verification

Course Runtime Verification Course Martin Leucker (ISP) Volker Stolz (Høgskolen i Bergen, NO) INF5140 / V17 Chapters of the Course Chapter 1 Recall in More Depth Chapter 2 Specification Languages on Words Chapter 3 LTL on Finite

More information

Applied Logic. Lecture 1 - Propositional logic. Marcin Szczuka. Institute of Informatics, The University of Warsaw

Applied Logic. Lecture 1 - Propositional logic. Marcin Szczuka. Institute of Informatics, The University of Warsaw Applied Logic Lecture 1 - Propositional logic Marcin Szczuka Institute of Informatics, The University of Warsaw Monographic lecture, Spring semester 2017/2018 Marcin Szczuka (MIMUW) Applied Logic 2018

More information

Learning Goals of CS245 Logic and Computation

Learning Goals of CS245 Logic and Computation Learning Goals of CS245 Logic and Computation Alice Gao April 27, 2018 Contents 1 Propositional Logic 2 2 Predicate Logic 4 3 Program Verification 6 4 Undecidability 7 1 1 Propositional Logic Introduction

More information

Control Predicates Are Better Than Dummy Variables For Reasoning About Program Control

Control Predicates Are Better Than Dummy Variables For Reasoning About Program Control Control Predicates Are Better Than Dummy Variables For Reasoning About Program Control LESLIE LAMPORT Digital Equipment Corporation When explicit control predicates rather than dummy variables are used,

More information

A Humble Introduction to DIJKSTRA S A A DISCIPLINE OF PROGRAMMING

A 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 information

THE AUSTRALIAN NATIONAL UNIVERSITY Second Semester COMP2600 (Formal Methods for Software Engineering)

THE 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 information

A Theory and Calculus for Reasoning about Sequential Behavior

A Theory and Calculus for Reasoning about Sequential Behavior A Theory and Calculus for Reasoning about Sequential Behavior FREDERICK FURTEK Applied Combinatorics, Menlo Park, CA 94025 USA, fred@calculus.com Basic results in combinatorial mathematics provide the

More information

Lecture Notes on DISCRETE MATHEMATICS. Eusebius Doedel

Lecture Notes on DISCRETE MATHEMATICS. Eusebius Doedel Lecture Notes on DISCRETE MATHEMATICS Eusebius Doedel c Eusebius J. Doedel, 009 Contents Logic. Introduction............................................................................... Basic logical

More information

Propositional and Predicate Logic

Propositional and Predicate Logic Formal Verification of Software Propositional and Predicate Logic Bernhard Beckert UNIVERSITÄT KOBLENZ-LANDAU B. Beckert: Formal Verification of Software p.1 Propositional Logic: Syntax Special symbols

More information

CHAPTER 2 INTRODUCTION TO CLASSICAL PROPOSITIONAL LOGIC

CHAPTER 2 INTRODUCTION TO CLASSICAL PROPOSITIONAL LOGIC CHAPTER 2 INTRODUCTION TO CLASSICAL PROPOSITIONAL LOGIC 1 Motivation and History The origins of the classical propositional logic, classical propositional calculus, as it was, and still often is called,

More information

Verifying Properties of Parallel Programs: An Axiomatic Approach

Verifying 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 information

Restricted truth predicates in first-order logic

Restricted truth predicates in first-order logic Restricted truth predicates in first-order logic Thomas Bolander 1 Introduction It is well-known that there exist consistent first-order theories that become inconsistent when we add Tarski s schema T.

More information

Size-Change Termination and Transition Invariants

Size-Change Termination and Transition Invariants Size-Change Termination and Transition Invariants Matthias Heizmann 1, Neil D. Jones 2, and Andreas Podelski 1 1 University of Freiburg, Germany 2 University of Copenhagen, Denmark Abstract. Two directions

More information

Lecture Notes 1 Basic Concepts of Mathematics MATH 352

Lecture Notes 1 Basic Concepts of Mathematics MATH 352 Lecture Notes 1 Basic Concepts of Mathematics MATH 352 Ivan Avramidi New Mexico Institute of Mining and Technology Socorro, NM 87801 June 3, 2004 Author: Ivan Avramidi; File: absmath.tex; Date: June 11,

More information

Partial model checking via abstract interpretation

Partial model checking via abstract interpretation Partial model checking via abstract interpretation N. De Francesco, G. Lettieri, L. Martini, G. Vaglini Università di Pisa, Dipartimento di Ingegneria dell Informazione, sez. Informatica, Via Diotisalvi

More information

Chapter 3. Specifications. 3.1 Hoare Triples. An Introduction to Separation Logic c 2011 John C. Reynolds February 3, 2011

Chapter 3. Specifications. 3.1 Hoare Triples. An Introduction to Separation Logic c 2011 John C. Reynolds February 3, 2011 Chapter 3 An Introduction to Separation Logic c 2011 John C. Reynolds February 3, 2011 Specifications From assertions, we move on to specifications, which describe the behavior of commands. In this chapter,

More information

Logical Abstract Domains and Interpretations

Logical Abstract Domains and Interpretations Logical Abstract Domains and Interpretations Patrick Cousot 2,3, Radhia Cousot 3,1, and Laurent Mauborgne 3,4 1 Centre National de la Recherche Scientifique, Paris 2 Courant Institute of Mathematical Sciences,

More information

An Equational Axiomatization for Multi-Exit Iteration

An Equational Axiomatization for Multi-Exit Iteration An Equational Axiomatization for Multi-Exit Iteration Luca Aceto BRICS Department of Computer Science Aalborg University, Fr. Bajersvej 7E 9220 Aalborg Ø, Denmark Wan Fokkink Utrecht University, Department

More information

Trace semantics: towards a unification of parallel paradigms Stephen Brookes. Department of Computer Science Carnegie Mellon University

Trace semantics: towards a unification of parallel paradigms Stephen Brookes. Department of Computer Science Carnegie Mellon University Trace semantics: towards a unification of parallel paradigms Stephen Brookes Department of Computer Science Carnegie Mellon University MFCSIT 2002 1 PARALLEL PARADIGMS State-based Shared-memory global

More information

Axiomatic 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 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 information

COMP 182 Algorithmic Thinking. Proofs. Luay Nakhleh Computer Science Rice University

COMP 182 Algorithmic Thinking. Proofs. Luay Nakhleh Computer Science Rice University COMP 182 Algorithmic Thinking Proofs Luay Nakhleh Computer Science Rice University 1 Reading Material Chapter 1, Section 3, 6, 7, 8 Propositional Equivalences The compound propositions p and q are called

More information

Hoare Logic and Model Checking

Hoare 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 information

1 FUNDAMENTALS OF LOGIC NO.10 HERBRAND THEOREM Tatsuya Hagino hagino@sfc.keio.ac.jp lecture URL https://vu5.sfc.keio.ac.jp/slide/ 2 So Far Propositional Logic Logical connectives (,,, ) Truth table Tautology

More information

Intro to Logic and Proofs

Intro to Logic and Proofs Intro to Logic and Proofs Propositions A proposition is a declarative sentence (that is, a sentence that declares a fact) that is either true or false, but not both. Examples: It is raining today. Washington

More information

T (s, xa) = T (T (s, x), a). The language recognized by M, denoted L(M), is the set of strings accepted by M. That is,

T (s, xa) = T (T (s, x), a). The language recognized by M, denoted L(M), is the set of strings accepted by M. That is, Recall A deterministic finite automaton is a five-tuple where S is a finite set of states, M = (S, Σ, T, s 0, F ) Σ is an alphabet the input alphabet, T : S Σ S is the transition function, s 0 S is the

More information

Formal Specification and Verification. Specifications

Formal 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 information

Axioms of Kleene Algebra

Axioms of Kleene Algebra Introduction to Kleene Algebra Lecture 2 CS786 Spring 2004 January 28, 2004 Axioms of Kleene Algebra In this lecture we give the formal definition of a Kleene algebra and derive some basic consequences.

More information

With Question/Answer Animations. Chapter 2

With Question/Answer Animations. Chapter 2 With Question/Answer Animations Chapter 2 Chapter Summary Sets The Language of Sets Set Operations Set Identities Functions Types of Functions Operations on Functions Sequences and Summations Types of

More information

Propositional Dynamic Logic

Propositional Dynamic Logic Propositional Dynamic Logic Contents 1 Introduction 1 2 Syntax and Semantics 2 2.1 Syntax................................. 2 2.2 Semantics............................... 2 3 Hilbert-style axiom system

More information

Probabilistic Guarded Commands Mechanized in HOL

Probabilistic 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 information

Demonic, angelic and unbounded probabilistic choices in sequential programs

Demonic, angelic and unbounded probabilistic choices in sequential programs Demonic, angelic and unbounded probabilistic choices in sequential programs AK McIver and Carroll Morgan ebruary 5, 2007 Abstract Probabilistic predicate transformers extend standard predicate transformers

More information