From OCL to Propositional and First-order Logic: Part I

Size: px
Start display at page:

Download "From OCL to Propositional and First-order Logic: Part I"

Transcription

1 22c181: Formal Methods in Software Engineering The University of Iowa Spring 2008 From OCL to Propositional and First-order Logic: Part I Copyright Reiner Hähnle and Cesare Tinelli. Notes originally developed by Reiner Hähnle at Chalmers University and modified by Cesare Tinelli at the University of Iowa. These notes are copyrighted materials and may not be used in other course settings outside of the University of Iowa in their current form or modified form without the express written permission of one of the copyright holders. 22c181: Formal Methods in Software Engineering p.1/32

2 Contents Overview of KeY UML and its semantics Introduction to OCL Specifying requirements with OCL Modelling of Systems with Formal Semantics Propositional & First-order logic, sequent calculus OCL to Logic, horizontal proof obligations, using KeY Dynamic logic, proving program correctness Java Card DL Vertical proof obligations, using KeY Wrap-up, trends 22c181: Formal Methods in Software Engineering p.2/32

3 Reminder: Object Diagrams and OCL id0815:person name = Jane age = 5 ownership harley17:bike colour = idblack idblack:colour black() = idblack white() = idwhite red() = idred id0825:person name = Paul age = 25 context inv: ownership bmw3:car colour = idwhite Vehicle self.owner.age >= 18 idwhite:colour black() = idblack white() = idwhite red() = idred idred:colour black() = idblack white() = idwhite red() = idred 22c181: Formal Methods in Software Engineering p.3/32

4 Reminder: Object Diagrams and OCL id0815:person name = Jane age = 5 ownership harley17:bike colour = idblack idblack:colour black() = idblack white() = idwhite red() = idred id0825:person name = Paul age = 25 context inv: ownership bmw3:car colour = idwhite Vehicle self.owner.age >= 18 I(Vehicle) = {harley17, bmw3} idwhite:colour black() = idblack white() = idwhite red() = idred idred:colour black() = idblack white() = idwhite red() = idred 22c181: Formal Methods in Software Engineering p.3/32

5 Reminder: Object Diagrams and OCL id0815:person name = Jane age = 5 ownership harley17:bike colour = idblack idblack:colour black() = idblack white() = idwhite red() = idred id0825:person name = Paul age = 25 context inv: ownership bmw3:car colour = idwhite Vehicle self.owner.age >= 18 I(Vehicle) = {harley17, bmw3} idwhite:colour black() = idblack white() = idwhite red() = idred idred:colour black() = idblack white() = idwhite red() = idred harley17.i(owner).i(age) 18 and bmw3.i(owner).i(age) 18 22c181: Formal Methods in Software Engineering p.3/32

6 Reminder: Object Diagrams and OCL id0815:person name = Jane age = 5 ownership harley17:bike colour = idblack idblack:colour black() = idblack white() = idwhite red() = idred id0825:person name = Paul age = 25 context inv: ownership bmw3:car colour = idwhite Vehicle self.owner.age >= 18 I(Vehicle) = {harley17, bmw3} idwhite:colour black() = idblack white() = idwhite red() = idred idred:colour black() = idblack white() = idwhite red() = idred harley17.i(owner).i(age) 18 and bmw3.i(owner).i(age) 18 I(owner) : Vehicle Person 22c181: Formal Methods in Software Engineering p.3/32

7 Reminder: Object Diagrams and OCL id0815:person name = Jane age = 5 ownership harley17:bike colour = idblack idblack:colour black() = idblack white() = idwhite red() = idred id0825:person name = Paul age = 25 context inv: ownership bmw3:car colour = idwhite Vehicle self.owner.age >= 18 I(Vehicle) = {harley17, bmw3} idwhite:colour black() = idblack white() = idwhite red() = idred idred:colour black() = idblack white() = idwhite red() = idred harley17.i(owner).i(age) 18 and bmw3.i(owner).i(age) 18 I(owner)(harley17) = I(owner)(bmw3) = id c181: Formal Methods in Software Engineering p.3/32

8 Reminder: Object Diagrams and OCL id0815:person name = Jane age = 5 ownership harley17:bike colour = idblack idblack:colour black() = idblack white() = idwhite red() = idred id0825:person name = Paul age = 25 context inv: ownership bmw3:car colour = idwhite Vehicle self.owner.age >= 18 I(Vehicle) = {harley17, bmw3} idwhite:colour black() = idblack white() = idwhite red() = idred idred:colour black() = idblack white() = idwhite red() = idred harley17.i(owner).i(age) 18 and bmw3.i(owner).i(age) 18 I(owner)(harley17) = I(owner)(bmw3) = id0825 id0825.i(age) 18 22c181: Formal Methods in Software Engineering p.3/32

9 Reminder: Object Diagrams and OCL id0815:person name = Jane age = 5 ownership harley17:bike colour = idblack idblack:colour black() = idblack white() = idwhite red() = idred id0825:person name = Paul age = 25 context inv: ownership bmw3:car colour = idwhite Vehicle self.owner.age >= 18 I(Vehicle) = {harley17, bmw3} idwhite:colour black() = idblack white() = idwhite red() = idred idred:colour black() = idblack white() = idwhite red() = idred harley17.i(owner).i(age) 18 and bmw3.i(owner).i(age) 18 I(owner)(harley17) = I(owner)(bmw3) = id0825 id0825.i(age) 18 I(age)(id0825) = c181: Formal Methods in Software Engineering p.3/32

10 OCL and Formal Proofs Snapshots provide formal semantics for UML and OCL can formally prove properties of model and implementation 22c181: Formal Methods in Software Engineering p.4/32

11 OCL and Formal Proofs Snapshots provide formal semantics for UML and OCL can formally prove properties of model and implementation Examples: Invariant of class A implies invariant of class B For each snapshot I: if A s invariant holds in I, then so does B s Horizontal verification problem (within specification) Implementation of operation m fulfills its contract For each snapshot I: if precondition of m holds in I, then its postcondition holds in snapshot I produced by execution of m Vertical verification problem (implementation against specification) 22c181: Formal Methods in Software Engineering p.4/32

12 Snapshots and States: Static View Snaphots have static and dynamic part 22c181: Formal Methods in Software Engineering p.5/32

13 Snapshots and States: Static View Snaphots have static and dynamic part Static (object diagram): objects, attribute values, associations Static part of snapshot similar to execution state of program Denote such states with s, set of all states S (infinite!) Think of one single state as object diagram Proving horizontal verification problem: state inclusion 22c181: Formal Methods in Software Engineering p.5/32

14 Snapshots and States: Static View Snaphots have static and dynamic part Static (object diagram): objects, attribute values, associations Static part of snapshot similar to execution state of program Denote such states with s, set of all states S (infinite!) Think of one single state as object diagram Proving horizontal verification problem: state inclusion Example: Let inv A be invariant of class A, inv B invariant of class B {s S inv A holds in s} {s S inv B holds in s} 22c181: Formal Methods in Software Engineering p.5/32

15 Snapshots and States: Dynamic View Program state s = static part of snapshot Set of all states S Dynamic part of snapshot: Semantics of operations m: ρ(m) : S S Operation can be seen as state transformer For each m and s S result state ρ(m)(s) ρ is partial function: programs deterministic, may not terminate Proving vertical verification problem: state reachability 22c181: Formal Methods in Software Engineering p.6/32

16 Snapshots and States: Dynamic View Program state s = static part of snapshot Set of all states S Dynamic part of snapshot: Semantics of operations m: ρ(m) : S S Operation can be seen as state transformer For each m and s S result state ρ(m)(s) ρ is partial function: programs deterministic, may not terminate Proving vertical verification problem: state reachability Example: Let pre be precondition, post postcondition of m Does post hold in all states s {ρ(m)(s) s satisfies pre}? Does post hold in all states s that can be reached via m from any state s satisfying pre? 22c181: Formal Methods in Software Engineering p.6/32

17 Dynamic Part of Snapshots as LTS (Deterministic) Labelled Transition System (LTS) K = (S, ρ): S set of states, ρ : Method (S S) (takes a program and returns a map from S to S), α = ρ(m), β = ρ(m ) a s 1 β s 2 α β α β s 4 α β a a s 5 s 6 s 3 Infinite number of states need theorem proving (or approximation) 22c181: Formal Methods in Software Engineering p.7/32

18 Dynamic Part of Snapshots as LTS Each state is a static snapshot (ie, object diagram) with the current objects and values. If ρ(m) takes, say, state s 1 into s 4, then a directed edge from s 1 to s 4 labelled with ρ(m) is present in K. ρ(m) is then a (possibly infinite) number of pre-/post execution state pairs. There is no explicit notion of initial state. One may consider as initial states those that satisfy the precondition of a distinguished main method (and possibly the invariant of its class). 22c181: Formal Methods in Software Engineering p.8/32

19 Encoding Verification Problem in Logic UML Model Patterns/Idioms CASE Tool Java (Card) (partial implementation) OCL (partial specification) Java (Card) RecodeR Univ Karlsruhe AST XML API AST FOL/Java Card DL OCL OCL Parser Univ Dresden Translation formula synthesis (vert. verif.) Formal proof Interactive/Automated Theorem Prover 22c181: Formal Methods in Software Engineering p.9/32

20 Why translate OCL into Logic? 22c181: Formal Methods in Software Engineering p.10/32

21 Why translate OCL into Logic? Difficult and expensive to develop theorem prover for a formalism OCL only one of many specification languages (JML, RSL, etc.) OCL prone to change (1.3, 1.4, 1.5,..., 2.0,...?) First order logic (FOL) well understood, mature tools FOL in verification like the Reals in Calculus 22c181: Formal Methods in Software Engineering p.10/32

22 Why translate OCL into Logic? Difficult and expensive to develop theorem prover for a formalism OCL only one of many specification languages (JML, RSL, etc.) OCL prone to change (1.3, 1.4, 1.5,..., 2.0,...?) First order logic (FOL) well understood, mature tools FOL in verification like the Reals in Calculus OCL not designed for verification, programming language independent OCL (UML) doesn t know about implementation of operations Need to incorporate Java data types and programs OCL not designed to express verification problems OCL doesn t know about (class) initialization (<2.0) 22c181: Formal Methods in Software Engineering p.10/32

23 Contents Overview of KeY UML and its semantics Introduction to OCL Specifying requirements with OCL Modelling of Systems with Formal Semantics Propositional & First-order logic, sequent calculus OCL to Logic, horizontal proof obligations, using KeY Dynamic logic, proving program correctness Java Card DL Vertical proof obligations, using KeY Wrap-up, trends 22c181: Formal Methods in Software Engineering p.11/32

24 Formalisation Real World Formalisation Formal Model 22c181: Formal Methods in Software Engineering p.12/32

25 Formalisation Formal Language Real World Formal Semantics 22c181: Formal Methods in Software Engineering p.12/32

26 Formalisation UML OCL Java Real World I, ρ Snapshots/LTS 22c181: Formal Methods in Software Engineering p.12/32

27 Formalisation UML OCL Java I, ρ Real World Snapshots/LTS infinite 22c181: Formal Methods in Software Engineering p.12/32

28 Formalisation UML OCL Java I, ρ Real World Snapshots/LTS infinite Calculus finite 22c181: Formal Methods in Software Engineering p.12/32

29 Formal Verification UML OCL Java I, ρ Real World Snapshot/ LTS infinite Calculus finite 22c181: Formal Methods in Software Engineering p.13/32

30 Formal Verification UML OCL Java I, ρ Real World Obj. Diagr. Snapshot/ LTS Calculus 22c181: Formal Methods in Software Engineering p.13/32

31 Formal Verification UML OCL Java I, ρ Translation FO Logic Dyn. Logic I, ρ Real World Obj. Diagr. Snapshot/ LTS FO Interp. Kripke Str. Calculus 22c181: Formal Methods in Software Engineering p.13/32

32 Formal Verification UML OCL Java I, ρ Translation FO Logic Dyn. Logic I, ρi, ρ, = Real World Obj. Diagr. Snapshot/ LTS Calculus FO Interp. Kripke Str. Sequent Calculus 22c181: Formal Methods in Software Engineering p.13/32

33 Syntax, Semantics, Calculus Syntax Formula I, ρ, = Semantics Valid Calculus Derivable 22c181: Formal Methods in Software Engineering p.14/32

34 Syntax, Semantics, Calculus Syntax Formula I, ρ, = Semantics Valid Calculus Derivable Completeness 22c181: Formal Methods in Software Engineering p.14/32

35 Syntax, Semantics, Calculus Syntax Formula I, ρ, = Semantics Valid Calculus Derivable Completeness Soundness 22c181: Formal Methods in Software Engineering p.14/32

36 Propositional Logic Propositional Formulas I, = Mapping Variables into {true, f alse} Sequent Calculus SAT solver 22c181: Formal Methods in Software Engineering p.15/32

37 Propositional Logic Propositional Formulas I, = Mapping Variables into {true, f alse} Sequent Calculus 22c181: Formal Methods in Software Engineering p.15/32

38 Contents Overview of KeY UML and its semantics Introduction to OCL Specifying requirements with OCL Modelling of Systems with Formal Semantics Propositional & First-order logic, sequent calculus OCL to Logic, horizontal proof obligations, using KeY Dynamic logic, proving program correctness Java Card DL Vertical proof obligations, using KeY Wrap-up, trends 22c181: Formal Methods in Software Engineering p.16/32

39 Propositional Logic: Syntax Propositional Formulas I, = Mapping Variables into {true, f alse} Sequent Calculus 22c181: Formal Methods in Software Engineering p.17/32

40 Syntax of Propositional Logic The Signature: Propositional Variables P = {p i i IN} with type Boolean 22c181: Formal Methods in Software Engineering p.18/32

41 Syntax of Propositional Logic The Signature: Propositional Variables P = {p i i IN} with type Boolean Connectives {true, false, &,,!, ->, <-> } 22c181: Formal Methods in Software Engineering p.18/32

42 Syntax of Propositional Logic The Signature: Propositional Variables P = {p i i IN} with type Boolean Connectives {true, false, &,,!, ->, <-> } Propositional Formulas For 0 (all have type Boolean) Truth constants true, false and variables P are formulas 22c181: Formal Methods in Software Engineering p.18/32

43 Syntax of Propositional Logic The Signature: Propositional Variables P = {p i i IN} with type Boolean Connectives {true, false, &,,!, ->, <-> } Propositional Formulas For 0 (all have type Boolean) Truth constants true, false and variables P are formulas If G and H are formulas then!g, (G &H), (G H), (G -> H), (G <-> H) are also formulas There are no other formulas (inductive definition) 22c181: Formal Methods in Software Engineering p.18/32

44 Propositional Logic: Semantics Propositional Formulas I, = Mapping Variables into {true, f alse} Sequent Calculus 22c181: Formal Methods in Software Engineering p.19/32

45 Semantics of Propositional Logic Interpretation I Assigns a truth value to each propositional variable I : P {true,false} 22c181: Formal Methods in Software Engineering p.20/32

46 Semantics of Propositional Logic Interpretation I Assigns a truth value to each propositional variable I : P {true,false} Valuation function val I : extension of I to For 0 val I : For 0 {true,false} 22c181: Formal Methods in Software Engineering p.20/32

47 Semantics of Propositional Logic Interpretation I Assigns a truth value to each propositional variable I : P {true,false} Valuation function val I : extension of I to For 0 val I (p i ) = I(p i ) val I (true) = true val I (false) = false val I : For 0 {true,false} true if val I (G) = false or val I (G -> H) = val I (H) = true f alse otherwise etc. I satisfies G if val I (G) = true; otherwise, it falsifies G. 22c181: Formal Methods in Software Engineering p.20/32

48 Example Formula p -> (q -> p) 22c181: Formal Methods in Software Engineering p.21/32

49 Example Formula p -> (q -> p) Interpretation (one of four that are possible) I(p) = true I(q) = false 22c181: Formal Methods in Software Engineering p.21/32

50 Example Formula p -> (q -> p) Interpretation (one of four that are possible) I(p) = true I(q) = false Valuation val I ( q -> p ) = true 22c181: Formal Methods in Software Engineering p.21/32

51 Example Formula p -> (q -> p) Interpretation (one of four that are possible) I(p) = true I(q) = false Valuation val I ( q -> p ) = true val I ( p -> (q -> p) ) = true 22c181: Formal Methods in Software Engineering p.21/32

52 Semantic Notions Let G For 0, Γ For 0 Validity Relation = G is valid in I iff val I (G) = true (write: I = G) A formula that is valid in some interpretation is satisfiable Γ entails G (Γ = G) iff for all interpretations I: If I = H for all H Γ then also I = G If G is valid in any interpretation, i.e = G (short : = G) then G is called logically valid 22c181: Formal Methods in Software Engineering p.22/32

53 Propositional Logic Examples Satisfiable? p & ((!p) q) 22c181: Formal Methods in Software Engineering p.23/32

54 Propositional Logic Examples p & ((!p) q) Satisfiable? Yes 22c181: Formal Methods in Software Engineering p.23/32

55 Propositional Logic Examples p & ((!p) q) Satisfiable? Yes Satisfying Interpretation? 22c181: Formal Methods in Software Engineering p.23/32

56 Propositional Logic Examples p & ((!p) q) Satisfiable? Yes Satisfying Interpretation? I(p) = true, I(q) = true 22c181: Formal Methods in Software Engineering p.23/32

57 Propositional Logic Examples p & ((!p) q) Satisfiable? Yes Satisfying Interpretation? I(p) = true, I(q) = true Does this hold? p & ((!p) q) = q r 22c181: Formal Methods in Software Engineering p.23/32

58 Propositional Logic Examples p & ((!p) q) Satisfiable? Yes Satisfying Interpretation? I(p) = true, I(q) = true Does this hold? Yes. Why? p & ((!p) q) = q r 22c181: Formal Methods in Software Engineering p.23/32

59 Propositional Logic Propositional Formulas I, = Mapping Variables into {true, f alse} Sequent Calculus 22c181: Formal Methods in Software Engineering p.24/32

60 Reasoning by Syntactic Transformation Establish = G by finite syntactic transformations of G 22c181: Formal Methods in Software Engineering p.25/32

61 Reasoning by Syntactic Transformation Establish = G by finite syntactic transformations of G (Logic) Calculus: a set of syntactic transformation rules R defining a property over For 0 such that = G iff G (G is derivable) = G implies G (Completeness) G implies = G (Soundness) 22c181: Formal Methods in Software Engineering p.25/32

62 Reasoning by Syntactic Transformation Establish = G by finite syntactic transformations of G (Logic) Calculus: a set of syntactic transformation rules R defining a property over For 0 such that = G iff G (G is derivable) = G implies G (Completeness) G implies = G (Soundness) Sequent Calculus based on notion of sequent ψ 1,...,ψ m }{{} Antecedent ==> φ 1,...,φ n }{{} Succedent has same semantics as (ψ 1 & &ψ m ) -> (φ 1 φ n ) {ψ 1,...,ψ m } = φ 1 φ n 22c181: Formal Methods in Software Engineering p.25/32

63 Notation for Sequents ψ 1,...,ψ m ==> φ 1,...,φ n Consider antecedent/succedent as sets of formulas, may be empty Use schema variables Γ,φ,... that match (sets of) formulas Characterize infinitely many formulas with a single sequent Γ ==>,φ&ψ Matches any sequent with occurrence of conjunction in succedent Call φ &ψ main formula and Γ, side formulas of sequent Any sequent of the form Γ,φ ==>,φ is logically valid, and is called an axiom 22c181: Formal Methods in Software Engineering p.26/32

64 Sequent Calculus Rules Basic idea: write syntactic transformation schema for sequents that reflects semantics of connectives as closely as possible rule name { Premisses }} { Γ 1 ==> 1 Γ r ==> r Γ ==> }{{} Conclusion 22c181: Formal Methods in Software Engineering p.27/32

65 Sequent Calculus Rules Basic idea: write syntactic transformation schema for sequents that reflects semantics of connectives as closely as possible Example rule name AND_RIGHT { Premisses }} { Γ 1 ==> 1 Γ r ==> r Γ ==> }{{} Conclusion Γ ==> φ, Γ ==> ψ, Γ ==> φ &ψ, 22c181: Formal Methods in Software Engineering p.27/32

66 Sequent Calculus Rules Basic idea: write syntactic transformation schema for sequents that reflects semantics of connectives as closely as possible Example rule name AND_RIGHT { Premisses }} { Γ 1 ==> 1 Γ r ==> r Γ ==> }{{} Conclusion Γ ==> φ, Γ ==> ψ, Γ ==> φ &ψ, Rules can have zero premisses (iff conclusion is valid, eg. an axiom) 22c181: Formal Methods in Software Engineering p.27/32

67 Sequent Calculus Rules Basic idea: write syntactic transformation schema for sequents that reflects semantics of connectives as closely as possible Example rule name AND_RIGHT { Premisses }} { Γ 1 ==> 1 Γ r ==> r Γ ==> }{{} Conclusion Γ ==> φ, Γ ==> ψ, Γ ==> φ &ψ, A rule is sound if every interpretation that satisfies each premiss of the rule also satisfies its conclusion (essential property) 22c181: Formal Methods in Software Engineering p.27/32

68 Sequent Calculus Rules Basic idea: write syntactic transformation schema for sequents that reflects semantics of connectives as closely as possible Example rule name AND_RIGHT { Premisses }} { Γ 1 ==> 1 Γ r ==> r Γ ==> }{{} Conclusion Γ ==> φ, Γ ==> ψ, Γ ==> φ &ψ, A rule is sound if every interpretation that satisfies each premiss of the rule also satisfies its conclusion (essential property) A rule is complete if every interpretation that satisfies its conclusion also satisfies each of its premisses (desirable property) 22c181: Formal Methods in Software Engineering p.27/32

69 Rules of Propositional Sequent Calculus main left side (work on antecedent) right side (work on succedent) not Γ ==> φ, Γ,!φ ==> Γ, φ ==> Γ ==>!φ, 22c181: Formal Methods in Software Engineering p.28/32

70 Rules of Propositional Sequent Calculus main left side (work on antecedent) right side (work on succedent) not and Γ ==> φ, Γ,!φ ==> Γ,φ,ψ ==> Γ,φ&ψ ==> Γ, φ ==> Γ ==>!φ, Γ ==> φ, Γ ==> ψ, Γ ==> φ &ψ, 22c181: Formal Methods in Software Engineering p.28/32

71 Rules of Propositional Sequent Calculus main left side (work on antecedent) right side (work on succedent) not and or Γ ==> φ, Γ,!φ ==> Γ,φ,ψ ==> Γ,φ&ψ ==> Γ, φ ==> Γ, ψ ==> Γ,φ ψ ==> Γ, φ ==> Γ ==>!φ, Γ ==> φ, Γ ==> ψ, Γ ==> φ &ψ, Γ ==> φ,ψ, Γ ==> φ ψ, 22c181: Formal Methods in Software Engineering p.28/32

72 Rules of Propositional Sequent Calculus main left side (work on antecedent) right side (work on succedent) not and or imp Γ ==> φ, Γ,!φ ==> Γ,φ,ψ ==> Γ,φ&ψ ==> Γ, φ ==> Γ, ψ ==> Γ,φ ψ ==> Γ ==> φ, Γ, ψ ==> Γ,φ -> ψ ==> Γ, φ ==> Γ ==>!φ, Γ ==> φ, Γ ==> ψ, Γ ==> φ &ψ, Γ ==> φ,ψ, Γ ==> φ ψ, Γ,φ ==> ψ, Γ ==> φ -> ψ, 22c181: Formal Methods in Software Engineering p.28/32

73 Rules of Propositional Sequent Calculus main left side (work on antecedent) right side (work on succedent) not and or imp Γ ==> φ, Γ,!φ ==> Γ,φ,ψ ==> Γ,φ&ψ ==> Γ, φ ==> Γ, ψ ==> Γ,φ ψ ==> Γ ==> φ, Γ, ψ ==> Γ,φ -> ψ ==> Γ, φ ==> Γ ==>!φ, Γ ==> φ, Γ ==> ψ, Γ ==> φ &ψ, Γ ==> φ,ψ, Γ ==> φ ψ, Γ,φ ==> ψ, Γ ==> φ -> ψ, CLOSE Γ,φ ==> φ, TRUE Γ ==> true, FALSE Γ, false ==> 22c181: Formal Methods in Software Engineering p.28/32

74 Justification of Rules Compute rules by applying semantics definition of connectives 22c181: Formal Methods in Software Engineering p.29/32

75 Justification of Rules Compute rules by applying semantics definition of connectives OR_RIGHT Γ ==> φ,ψ, Γ ==> φ ψ, Follows directly from semantics of sequents 22c181: Formal Methods in Software Engineering p.29/32

76 Justification of Rules Compute rules by applying semantics definition of connectives OR_RIGHT Γ ==> φ,ψ, Γ ==> φ ψ, Follows directly from semantics of sequents AND_RIGHT Γ ==> φ, Γ ==> ψ, Γ ==> φ &ψ, Γ -> (φ &ψ) iff Γ -> φ and Γ -> ψ Distributivity of & over and -> 22c181: Formal Methods in Software Engineering p.29/32

77 Sequent Calculus Proofs Goal to prove: G = ψ 1,...,ψ m ==> φ 1,...,φ n find rule R whose conclusion matches G instantiate R such that conclusion identical to G recursively find proofs for resulting premisses G 1,..., G r tree structure with goal as root close proof branch when rule without premise encountered Goal-directed proof search In KeY tool proof displayed as JAVA Swing tree 22c181: Formal Methods in Software Engineering p.30/32

78 A Simple Proof ==> (A &(A -> B)) -> B 22c181: Formal Methods in Software Engineering p.31/32

79 A Simple Proof A &(A -> B) ==> B ==> (A &(A -> B)) -> B By imp right Γ,φ ==> ψ, Γ ==> φ -> ψ, 22c181: Formal Methods in Software Engineering p.31/32

80 A Simple Proof A,(A -> B) ==> B A &(A -> B) ==> B ==> (A &(A -> B)) -> B By and left Γ,φ,ψ ==> Γ,φ&ψ ==> 22c181: Formal Methods in Software Engineering p.31/32

81 A Simple Proof A ==> B,A A,B ==> B A,(A -> B) ==> B A &(A -> B) ==> B ==> (A &(A -> B)) -> B By imp left Γ ==> φ, Γ,ψ ==> Γ,φ -> ψ ==> 22c181: Formal Methods in Software Engineering p.31/32

82 A Simple Proof CLOSE A ==> B,A A,B ==> B CLOSE A,(A -> B) ==> B A &(A -> B) ==> B ==> (A &(A -> B)) -> B By close Γ,φ ==> φ, 22c181: Formal Methods in Software Engineering p.31/32

83 A Simple Proof CLOSE A ==> B,A A,B ==> B CLOSE A,(A -> B) ==> B A &(A -> B) ==> B ==> (A &(A -> B)) -> B A proof is closed, if all its branches are closed. 22c181: Formal Methods in Software Engineering p.31/32

84 Propositional Logic is insufficient A ALL PERSONS ARE HAPPY 22c181: Formal Methods in Software Engineering p.32/32

85 Propositional Logic is insufficient A B ALL PERSONS ARE HAPPY PAT IS A PERSON 22c181: Formal Methods in Software Engineering p.32/32

86 Propositional Logic is insufficient A B? ALL PERSONS ARE HAPPY PAT IS A PERSON PAT IS HAPPY Propositional logic lacks possibility to talk about individuals In particular, need to model objects, attributes, associations, etc. 22c181: Formal Methods in Software Engineering p.32/32

87 Propositional Logic is insufficient A B? ALL PERSONS ARE HAPPY PAT IS A PERSON PAT IS HAPPY Propositional logic lacks possibility to talk about individuals In particular, need to model objects, attributes, associations, etc. First-Order Logic (FOL) 22c181: Formal Methods in Software Engineering p.32/32

Overview of the KeY System

Overview of the KeY System 22c181: Formal Methods in Software Engineering The University of Iowa Spring 2008 Overview of the KeY System Copyright 2007-8 Reiner Hähnle and Cesare Tinelli. Notes originally developed by Reiner Hähnle

More information

From OCL to Typed First-order Logic

From OCL to Typed First-order Logic 22c181: Formal Methods in Software Engineering The University of Iowa Spring 2008 From OCL to Typed First-order Logic Copyright 2007-8 Reiner Hähnle and Cesare Tinelli. Notes originally developed by Reiner

More information

Typed First-order Logic

Typed First-order Logic 22c181: Formal Methods in Software Engineering The University of Iowa Spring 2008 Typed First-order Logic Copyright 2007-8 Reiner Hähnle and Cesare Tinelli. Notes originally developed by Reiner Hähnle

More information

Fundamentals of Software Engineering

Fundamentals of Software Engineering Fundamentals of Software Engineering Reasoning about Programs with Dynamic Logic - Part I Ina Schaefer Institute for Software Systems Engineering TU Braunschweig, Germany Slides by Wolfgang Ahrendt, Richard

More information

15-819M: Data, Code, Decisions

15-819M: Data, Code, Decisions 15-819M: Data, Code, Decisions 08: First-Order Logic André Platzer aplatzer@cs.cmu.edu Carnegie Mellon University, Pittsburgh, PA André Platzer (CMU) 15-819M/08: Data, Code, Decisions 1 / 40 Outline 1

More information

Formal Systems II: Applications

Formal Systems II: Applications Formal Systems II: Applications Functional Verification of Java Programs: Java Dynamic Logic Bernhard Beckert Mattias Ulbrich SS 2017 KIT INSTITUT FÜR THEORETISCHE INFORMATIK KIT University of the State

More information

Fundamentals of Software Engineering

Fundamentals of Software Engineering Fundamentals of Software Engineering Reasoning about Programs - Selected Features Ina Schaefer Institute for Software Systems Engineering TU Braunschweig, Germany Slides by Wolfgang Ahrendt, Richard Bubel,

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

A Short Introduction to First-Order Theorem Proving with KeY

A Short Introduction to First-Order Theorem Proving with KeY 1 What is KeY? 1.1 Software Verification Karlsruher Institut für Technologie Institut für Theoretische Informatik Prof. Dr. Peter H. Schmitt Mattias Ulbrich A Short Introduction to First-Order Theorem

More information

Overview. CS389L: Automated Logical Reasoning. Lecture 6: First Order Logic Syntax and Semantics. Constants in First-Order Logic.

Overview. CS389L: Automated Logical Reasoning. Lecture 6: First Order Logic Syntax and Semantics. Constants in First-Order Logic. Overview CS389L: Automated Logical Reasoning Lecture 6: First Order Logic Syntax and Semantics Işıl Dillig So far: Automated reasoning in propositional logic. Propositional logic is simple and easy to

More information

Propositional Logic. Part I

Propositional Logic. Part I Part I Propositional Logic 1 Classical Logic and the Material Conditional 1.1 Introduction 1.1.1 The first purpose of this chapter is to review classical propositional logic, including semantic tableaux.

More information

Finite Model Generation for Isabelle/HOL Using a SAT Solver

Finite Model Generation for Isabelle/HOL Using a SAT Solver Finite Model Generation for / Using a SAT Solver Tjark Weber webertj@in.tum.de Technische Universität München Winterhütte, März 2004 Finite Model Generation for / p.1/21 is a generic proof assistant: Highly

More information

Typed Lambda Calculus for Syntacticians

Typed Lambda Calculus for Syntacticians Department of Linguistics Ohio State University January 12, 2012 The Two Sides of Typed Lambda Calculus A typed lambda calculus (TLC) can be viewed in two complementary ways: model-theoretically, as a

More information

Handling Integer Arithmetic in the Verification of Java Programs

Handling Integer Arithmetic in the Verification of Java Programs Handling Integer Arithmetic in the Verification of Java Programs Steffen Schlager 1st Swedish-German KeY Workshop Göteborg, Sweden, June 2002 KeY workshop, June 2002 p.1 Introduction UML/OCL specification

More information

Propositional Logic Formal Syntax and Semantics. Computability and Logic

Propositional Logic Formal Syntax and Semantics. Computability and Logic Propositional Logic Formal Syntax and Semantics Computability and Logic Syntax and Semantics Syntax: The study of how expressions are structured (think: grammar) Semantics: The study of the relationship

More information

From Hoare Logic to Matching Logic Reachability. Grigore Rosu and Andrei Stefanescu University of Illinois, USA

From Hoare Logic to Matching Logic Reachability. Grigore Rosu and Andrei Stefanescu University of Illinois, USA From Hoare Logic to Matching Logic Reachability Grigore Rosu and Andrei Stefanescu University of Illinois, USA Matching Logic Reachability - Goal - Language independent program verification framework Derives

More information

Testing, Debugging, Program Verification

Testing, Debugging, Program Verification Testing, Debugging, Program Verification Automated Test Case Generation, Part II Wolfgang Ahrendt & Vladimir Klebanov & Moa Johansson 12 December 2012 TDV: ATCG II /GU 2011-12-12 1 / 17 Recap Specification-/Model-Based

More information

Fundamentals of Software Engineering

Fundamentals of Software Engineering Fundamentals of Software Engineering Reasoning about Programs with Dynamic Logic - Part II Ina Schaefer Institute for Software Systems Engineering TU Braunschweig, Germany Slides by Wolfgang Ahrendt, Richard

More information

Typed Lambda Calculus

Typed Lambda Calculus Department of Linguistics Ohio State University Sept. 8, 2016 The Two Sides of A typed lambda calculus (TLC) can be viewed in two complementary ways: model-theoretically, as a system of notation for functions

More information

Verifying Java Programs Verifying Java Programs with KeY

Verifying Java Programs Verifying Java Programs with KeY Verifying Java Programs Verifying Java Programs with KeY Wolfgang Schreiner Wolfgang.Schreiner@risc.jku.at Research Institute for Symbolic Computation (RISC) Johannes Kepler University, Linz, Austria http://www.risc.jku.at

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

Semantics and Pragmatics of NLP Propositional Logic, Predicates and Functions

Semantics and Pragmatics of NLP Propositional Logic, Predicates and Functions , Semantics and Pragmatics of NLP, and s Alex Ewan School of Informatics University of Edinburgh 10 January 2008 , 1 2 3 4 Why Bother?, Aim: 1 To associate NL expressions with semantic representations;

More information

Software Engineering using Formal Methods

Software Engineering using Formal Methods Software Engineering using Formal Methods Reasoning about Programs with Dynamic Logic Wolfgang Ahrendt & Richard Bubel & Wojciech Mostowski 5 October 2011 SEFM: Java DL /GU 111005 1 / 45 Dynamic Logic

More information

Definition: A context-free grammar (CFG) is a 4- tuple. variables = nonterminals, terminals, rules = productions,,

Definition: A context-free grammar (CFG) is a 4- tuple. variables = nonterminals, terminals, rules = productions,, CMPSCI 601: Recall From Last Time Lecture 5 Definition: A context-free grammar (CFG) is a 4- tuple, variables = nonterminals, terminals, rules = productions,,, are all finite. 1 ( ) $ Pumping Lemma for

More information

A Logic of Proofs for Differential Dynamic Logic

A Logic of Proofs for Differential Dynamic Logic 1 A Logic of Proofs for Differential Dynamic Logic Toward Independently Checkable Proof Certificates for Differential Dynamic Logic Nathan Fulton Andrè Platzer Carnegie Mellon University CPP 16 February

More information

COMBINING PARTIAL EVALUATION AND SYMBOLIC EXECUTION

COMBINING PARTIAL EVALUATION AND SYMBOLIC EXECUTION COMBINING PARTIAL EVALUATION AND SYMBOLIC EXECUTION Reiner Hähnle & Richard Bubel Chalmers University Symposium 09 Speyer CONTROL CIRCUIT y = 80; threshold = 100; if (y > threshold) { decrease = true;

More information

Note that in this definition, n + m denotes the syntactic expression with three symbols n, +, and m, not to the number that is the sum of n and m.

Note that in this definition, n + m denotes the syntactic expression with three symbols n, +, and m, not to the number that is the sum of n and m. CS 6110 S18 Lecture 8 Structural Operational Semantics and IMP Today we introduce a very simple imperative language, IMP, along with two systems of rules for evaluation called small-step and big-step semantics.

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

Verifying Java Programs Verifying Java Programs with KeY

Verifying Java Programs Verifying Java Programs with KeY Verifying Java Programs Verifying Java Programs with KeY Wolfgang Schreiner Wolfgang.Schreiner@risc.jku.at Research Institute for Symbolic Computation (RISC) Johannes Kepler University, Linz, Austria http://www.risc.jku.at

More information

A Theorem Prover for Differential Dynamic Logic

A Theorem Prover for Differential Dynamic Logic A Theorem Prover for Differential Dynamic Logic Deductive Verification of Hybrid Systems April 17, 2007 Jan-David Quesel Carl von Ossietzky Universität Oldenburg Fakultät II Department für Informatik Abteilung

More information

Formal Specification and Verification

Formal Specification and Verification Formal Specification and Verification Proof Obligations Bernhard Beckert Based on a lecture by Wolfgang Ahrendt and Reiner Hähnle at Chalmers University, Göteborg Formal Specification and Verification:

More information

Main Goal. Language-independent program verification framework. Derive program properties from operational semantics

Main Goal. Language-independent program verification framework. Derive program properties from operational semantics Main Goal Language-independent program verification framework Derive program properties from operational semantics Questions: Is it possible? Is it practical? Answers: Sound and complete proof system,

More information

Formal Systems and their Applications

Formal Systems and their Applications Formal Systems and their Applications Dave Clarke (Dave.Clarke@cs.kuleuven.be) Acknowledgment: these slides are based in part on slides from Benjamin Pierce and Frank Piessens 1 Course Overview Introduction

More information

Fundamentals of Software Engineering

Fundamentals of Software Engineering Fundamentals of Software Engineering Reasoning about Programs with Dynamic Logic - Part II Ina Schaefer Institute for Software Systems Engineering TU Braunschweig, Germany Slides by Wolfgang Ahrendt, Richard

More information

Introduction to Axiomatic Semantics

Introduction to Axiomatic Semantics Introduction to Axiomatic Semantics Meeting 10, CSCI 5535, Spring 2009 Announcements Homework 3 due tonight Homework 2 is graded 13 (mean), 14 (median), out of 21 total, but Graduate class: final project

More information

KeY Quicktour. 1 Introduction/Prerequisites Version Information Logical Foundations The KeY-Prover... 2

KeY Quicktour. 1 Introduction/Prerequisites Version Information Logical Foundations The KeY-Prover... 2 KeY Quicktour Thomas Baar University of Karlsruhe Dept. of Computer Science D-76128 Karlsruhe baar@ira.uka.de Reiner Hähnle Chalmers University of Technology Dept. of Computing Science S-41296 Gothenburg

More information

Propositional Calculus: Boolean Algebra and Simplification. CS 270: Mathematical Foundations of Computer Science Jeremy Johnson

Propositional Calculus: Boolean Algebra and Simplification. CS 270: Mathematical Foundations of Computer Science Jeremy Johnson Propositional Calculus: Boolean Algebra and Simplification CS 270: Mathematical Foundations of Computer Science Jeremy Johnson Propositional Calculus Topics Motivation: Simplifying Conditional Expressions

More information

Semantics with Applications 3. More on Operational Semantics

Semantics with Applications 3. More on Operational Semantics Semantics with Applications 3. More on Operational Semantics Hanne Riis Nielson, Flemming Nielson (thanks to Henrik Pilegaard) [SwA] Hanne Riis Nielson, Flemming Nielson Semantics with Applications: An

More information

Verifying Java Programs with KeY

Verifying Java Programs with KeY Verifying Java Programs with KeY Wolfgang Schreiner Wolfgang.Schreiner@risc.jku.at Research Institute for Symbolic Computation (RISC) Johannes Kepler University, Linz, Austria http://www.risc.jku.at Wolfgang

More information

Part II. Hoare Logic and Program Verification. Why specify programs? Specification and Verification. Code Verification. Why verify programs?

Part II. Hoare Logic and Program Verification. Why specify programs? Specification and Verification. Code Verification. Why verify programs? Part II. Hoare Logic and Program Verification Part II. Hoare Logic and Program Verification Dilian Gurov Props: Models: Specs: Method: Tool: safety of data manipulation source code logic assertions Hoare

More information

Lectures 20, 21: Axiomatic Semantics

Lectures 20, 21: Axiomatic Semantics Lectures 20, 21: Axiomatic Semantics Polyvios Pratikakis Computer Science Department, University of Crete Type Systems and Static Analysis Based on slides by George Necula Pratikakis (CSD) Axiomatic Semantics

More information

CS 512, Spring 2017: Take-Home End-of-Term Examination

CS 512, Spring 2017: Take-Home End-of-Term Examination CS 512, Spring 2017: Take-Home End-of-Term Examination Out: Tuesday, 9 May 2017, 12:00 noon Due: Wednesday, 10 May 2017, by 11:59 am Turn in your solutions electronically, as a single PDF file, by placing

More information

CSCI.6962/4962 Software Verification Fundamental Proof Methods in Computer Science (Arkoudas and Musser) Chapter p. 1/27

CSCI.6962/4962 Software Verification Fundamental Proof Methods in Computer Science (Arkoudas and Musser) Chapter p. 1/27 CSCI.6962/4962 Software Verification Fundamental Proof Methods in Computer Science (Arkoudas and Musser) Chapter 2.1-2.7 p. 1/27 CSCI.6962/4962 Software Verification Fundamental Proof Methods in Computer

More information

6.0 ECTS/4.5h VU Programm- und Systemverifikation ( ) June 22, 2016

6.0 ECTS/4.5h VU Programm- und Systemverifikation ( ) June 22, 2016 6.0 ECTS/4.5h VU Programm- und Systemverifikation (184.741) June 22, 2016 Kennzahl (study id) Matrikelnummer (student id) Familienname (family name) Vorname (first name) Gruppe (version) A 1.) Coverage

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

Hoare Logic. COMP2600 Formal Methods for Software Engineering. Rajeev Goré

Hoare Logic. COMP2600 Formal Methods for Software Engineering. Rajeev Goré Hoare Logic COMP2600 Formal Methods for Software Engineering Rajeev Goré Australian National University Semester 2, 2016 (Slides courtesy of Ranald Clouston) COMP 2600 Hoare Logic 1 Australian Capital

More information

Software Engineering Lecture Notes

Software Engineering Lecture Notes Software Engineering Lecture Notes Paul C. Attie August 30, 2013 c Paul C. Attie. All rights reserved. 2 Contents I Hoare Logic 11 1 Propositional Logic 13 1.1 Introduction and Overview..............................

More information

Theorem proving. PVS theorem prover. Hoare style verification PVS. More on embeddings. What if. Abhik Roychoudhury CS 6214

Theorem proving. PVS theorem prover. Hoare style verification PVS. More on embeddings. What if. Abhik Roychoudhury CS 6214 Theorem proving PVS theorem prover Abhik Roychoudhury National University of Singapore Both specification and implementation can be formalized in a suitable logic. Proof rules for proving statements in

More information

Distributed Systems Programming (F21DS1) Formal Verification

Distributed Systems Programming (F21DS1) Formal Verification Distributed Systems Programming (F21DS1) Formal Verification Andrew Ireland Department of Computer Science School of Mathematical and Computer Sciences Heriot-Watt University Edinburgh Overview Focus on

More information

LOGIC AND DISCRETE MATHEMATICS

LOGIC AND DISCRETE MATHEMATICS LOGIC AND DISCRETE MATHEMATICS A Computer Science Perspective WINFRIED KARL GRASSMANN Department of Computer Science University of Saskatchewan JEAN-PAUL TREMBLAY Department of Computer Science University

More information

Towards a Logical Reconstruction of Relational Database Theory

Towards a Logical Reconstruction of Relational Database Theory Towards a Logical Reconstruction of Relational Database Theory On Conceptual Modelling, Lecture Notes in Computer Science. 1984 Raymond Reiter Summary by C. Rey November 27, 2008-1 / 63 Foreword DB: 2

More information

Where Can We Draw The Line?

Where Can We Draw The Line? Where Can We Draw The Line? On the Hardness of Satisfiability Problems Complexity 1 Introduction Objectives: To show variants of SAT and check if they are NP-hard Overview: Known results 2SAT Max2SAT Complexity

More information

Semantics and Pragmatics of NLP

Semantics and Pragmatics of NLP Semantics and Pragmatics of NLP Alex Ewan School of Informatics University of Edinburgh 10 January 2008 1 2 3 Transitive Verbs as Functions We looked at replacing n-ary relations with functions. How does

More information

The KeY System 1.0 (Deduction Component)

The KeY System 1.0 (Deduction Component) The KeY System 1.0 (Deduction Component) Bernhard Beckert, Martin Giese, Reiner Hähnle, Vladimir Klebanov, Philipp Rümmer, Steffen Schlager, and Peter H. Schmitt www.key-project.org Abstract. The KeY system

More information

CSC 501 Semantics of Programming Languages

CSC 501 Semantics of Programming Languages CSC 501 Semantics of Programming Languages Subtitle: An Introduction to Formal Methods. Instructor: Dr. Lutz Hamel Email: hamel@cs.uri.edu Office: Tyler, Rm 251 Books There are no required books in this

More information

Semantics. There is no single widely acceptable notation or formalism for describing semantics Operational Semantics

Semantics. There is no single widely acceptable notation or formalism for describing semantics Operational Semantics There is no single widely acceptable notation or formalism for describing semantics Operational Describe the meaning of a program by executing its statements on a machine, either simulated or actual. The

More information

CMSC 330: Organization of Programming Languages. Formal Semantics of a Prog. Lang. Specifying Syntax, Semantics

CMSC 330: Organization of Programming Languages. Formal Semantics of a Prog. Lang. Specifying Syntax, Semantics Recall Architecture of Compilers, Interpreters CMSC 330: Organization of Programming Languages Source Scanner Parser Static Analyzer Operational Semantics Intermediate Representation Front End Back End

More information

Propositional Calculus: Boolean Functions and Expressions. CS 270: Mathematical Foundations of Computer Science Jeremy Johnson

Propositional Calculus: Boolean Functions and Expressions. CS 270: Mathematical Foundations of Computer Science Jeremy Johnson Propositional Calculus: Boolean Functions and Expressions CS 270: Mathematical Foundations of Computer Science Jeremy Johnson Propositional Calculus Objective: To provide students with the concepts and

More information

Towards a GUI for Program Verification with KeY. Master of Science Thesis in the Programme Software Engineering and Technology

Towards a GUI for Program Verification with KeY. Master of Science Thesis in the Programme Software Engineering and Technology Towards a GUI for Program Verification with KeY Master of Science Thesis in the Programme Software Engineering and Technology Chalmers University of Technology University of Gothenburg Department of Computer

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

3.7 Denotational Semantics

3.7 Denotational Semantics 3.7 Denotational Semantics Denotational semantics, also known as fixed-point semantics, associates to each programming language construct a well-defined and rigorously understood mathematical object. These

More information

Formal Verification. Lecture 10

Formal Verification. Lecture 10 Formal Verification Lecture 10 Formal Verification Formal verification relies on Descriptions of the properties or requirements of interest Descriptions of systems to be analyzed, and rely on underlying

More information

An Annotated Language

An Annotated Language Hoare Logic An Annotated Language State and Semantics Expressions are interpreted as functions from states to the corresponding domain of interpretation Operators have the obvious interpretation Free of

More information

Higher-Order Logic. Specification and Verification with Higher-Order Logic

Higher-Order Logic. Specification and Verification with Higher-Order Logic Higher-Order Logic Specification and Verification with Higher-Order Logic Arnd Poetzsch-Heffter (Slides by Jens Brandt) Software Technology Group Fachbereich Informatik Technische Universität Kaiserslautern

More information

Situation Calculus and YAGI

Situation Calculus and YAGI Situation Calculus and YAGI Institute for Software Technology 1 Progression another solution to the projection problem does a sentence hold for a future situation used for automated reasoning and planning

More information

From Hoare Logic to Matching Logic Reachability

From Hoare Logic to Matching Logic Reachability From Hoare Logic to Matching Logic Reachability Grigore Roşu 1,2 and Andrei Ştefănescu 1 1 University of Illinois at Urbana-Champaign, USA 2 Alexandru Ioan Cuza University, Iaşi, Romania {grosu, stefane1}@illinois.edu

More information

LTCS Report. Concept Descriptions with Set Constraints and Cardinality Constraints. Franz Baader. LTCS-Report 17-02

LTCS Report. Concept Descriptions with Set Constraints and Cardinality Constraints. Franz Baader. LTCS-Report 17-02 Technische Universität Dresden Institute for Theoretical Computer Science Chair for Automata Theory LTCS Report Concept Descriptions with Set Constraints and Cardinality Constraints Franz Baader LTCS-Report

More information

Chapter 3. Describing Syntax and Semantics

Chapter 3. Describing Syntax and Semantics Chapter 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 of Programs:

More information

Induction and Semantics in Dafny

Induction and Semantics in Dafny 15-414 Lecture 11 1 Instructor: Matt Fredrikson Induction and Semantics in Dafny TA: Ryan Wagner Encoding the syntax of Imp Recall the abstract syntax of Imp: a AExp ::= n Z x Var a 1 + a 2 b BExp ::=

More information

Verifying Safety Property of Lustre Programs: Temporal Induction

Verifying Safety Property of Lustre Programs: Temporal Induction 22c181: Formal Methods in Software Engineering The University of Iowa Spring 2008 Verifying Safety Property of Lustre Programs: Temporal Induction Copyright 2008 Cesare Tinelli. These notes are copyrighted

More information

This is already grossly inconvenient in present formalisms. Why do we want to make this convenient? GENERAL GOALS

This is already grossly inconvenient in present formalisms. Why do we want to make this convenient? GENERAL GOALS 1 THE FORMALIZATION OF MATHEMATICS by Harvey M. Friedman Ohio State University Department of Mathematics friedman@math.ohio-state.edu www.math.ohio-state.edu/~friedman/ May 21, 1997 Can mathematics be

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

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

Chapter 3. Describing Syntax and Semantics ISBN

Chapter 3. Describing Syntax and Semantics ISBN Chapter 3 Describing Syntax and Semantics ISBN 0-321-49362-1 Chapter 3 Topics Describing the Meanings of Programs: Dynamic Semantics Copyright 2015 Pearson. All rights reserved. 2 Semantics There is no

More information

Chapter 3: Propositional Languages

Chapter 3: Propositional Languages Chapter 3: Propositional Languages We define here a general notion of a propositional language. We show how to obtain, as specific cases, various languages for propositional classical logic and some non-classical

More information

Towards Combined Static and Runtime Verification of Distributed Software

Towards Combined Static and Runtime Verification of Distributed Software Towards Combined Static and Runtime Verification of Distributed Software Wolfgang Ahrendt Chalmers University of Technology, Gothenburg, Sweden Seminar on Distributed Runtime Verification Bertinoro, 18

More information

Combining Static and Dynamic Contract Checking for Curry

Combining Static and Dynamic Contract Checking for Curry Michael Hanus (CAU Kiel) Combining Static and Dynamic Contract Checking for Curry LOPSTR 2017 1 Combining Static and Dynamic Contract Checking for Curry Michael Hanus University of Kiel Programming Languages

More information

Module 6. Knowledge Representation and Logic (First Order Logic) Version 2 CSE IIT, Kharagpur

Module 6. Knowledge Representation and Logic (First Order Logic) Version 2 CSE IIT, Kharagpur Module 6 Knowledge Representation and Logic (First Order Logic) 6.1 Instructional Objective Students should understand the advantages of first order logic as a knowledge representation language Students

More information

Chapter 3. Semantics. Topics. Introduction. Introduction. Introduction. Introduction

Chapter 3. Semantics. Topics. Introduction. Introduction. Introduction. Introduction Topics Chapter 3 Semantics Introduction Static Semantics Attribute Grammars Dynamic Semantics Operational Semantics Axiomatic Semantics Denotational Semantics 2 Introduction Introduction Language implementors

More information

Dynamic Frames in Java Dynamic Logic

Dynamic Frames in Java Dynamic Logic Dynamic Frames in Java Dynamic Logic Peter H Schmitt, Mattias Ulbrich, and Benjamin Weiß Karlsruhe Institute of Technology Institute for Theoretical Computer Science D-76128 Karlsruhe, Germany {pschmitt,mulbrich,bweiss}@iraukade

More information

Chapter 2 (First-Order Logic) of. Verification of Object-Oriented Software

Chapter 2 (First-Order Logic) of. Verification of Object-Oriented Software Chapter 2 (First-Order Logic) of Verification of Object-Oriented Software The KeY approach c 2007 Springer Verlag 1 First-Order Logic by Martin Giese In this chapter, we introduce a first-order logic.

More information

Handout 9: Imperative Programs and State

Handout 9: Imperative Programs and State 06-02552 Princ. of Progr. Languages (and Extended ) The University of Birmingham Spring Semester 2016-17 School of Computer Science c Uday Reddy2016-17 Handout 9: Imperative Programs and State Imperative

More information

Denotational Semantics

Denotational Semantics Denotational Semantics 8 12 lectures for Part II CST 2010/11 Marcelo Fiore Course web page: http://www.cl.cam.ac.uk/teaching/1011/denotsem/ 1 Lecture 1 Introduction 2 What is this course about? General

More information

Automated Reasoning. Natural Deduction in First-Order Logic

Automated Reasoning. Natural Deduction in First-Order Logic Automated Reasoning Natural Deduction in First-Order Logic Jacques Fleuriot Automated Reasoning Lecture 4, page 1 Problem Consider the following problem: Every person has a heart. George Bush is a person.

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

Binary Decision Diagrams

Binary Decision Diagrams Logic and roof Hilary 2016 James Worrell Binary Decision Diagrams A propositional formula is determined up to logical equivalence by its truth table. If the formula has n variables then its truth table

More information

2 Introduction to operational semantics

2 Introduction to operational semantics 2 Introduction to operational semantics This chapter presents the syntax of a programming language, IMP, a small language of while programs. IMP is called an "imperative" language because program execution

More information

T Reactive Systems: Kripke Structures and Automata

T Reactive Systems: Kripke Structures and Automata Tik-79.186 Reactive Systems 1 T-79.186 Reactive Systems: Kripke Structures and Automata Spring 2005, Lecture 3 January 31, 2005 Tik-79.186 Reactive Systems 2 Properties of systems invariants: the system

More information

Application: Programming Language Semantics

Application: Programming Language Semantics Chapter 8 Application: Programming Language Semantics Prof. Dr. K. Madlener: Specification and Verification in Higher Order Logic 527 Introduction to Programming Language Semantics Programming Language

More information

Software Engineering: A Practitioner s s Approach, 6/e Roger Pressman. Chapter 28 Formal Methods

Software Engineering: A Practitioner s s Approach, 6/e Roger Pressman. Chapter 28 Formal Methods Software Engineering: A Practitioner s s Approach, 6/e Roger Pressman Chapter 28 Formal Methods 1 Problems with Conventional Specification contradictions ambiguities vagueness incompleteness mixed levels

More information

Logic as a framework for NL semantics. Outline. Syntax of FOL [1] Semantic Theory Type Theory

Logic as a framework for NL semantics. Outline. Syntax of FOL [1] Semantic Theory Type Theory Logic as a framework for NL semantics Semantic Theory Type Theory Manfred Pinkal Stefan Thater Summer 2007 Approximate NL meaning as truth conditions. Logic supports precise, consistent and controlled

More information

Formal Methods for Java

Formal Methods for Java Formal Methods for Java Lecture 30: Conclusion Jochen Hoenicke Software Engineering Albert-Ludwigs-University Freiburg Feb 17, 2012 Jochen Hoenicke (Software Engineering) FM4J Feb 17, 2012 1 / 21 Topics

More information

Formal Methods. CITS5501 Software Testing and Quality Assurance

Formal Methods. CITS5501 Software Testing and Quality Assurance Formal Methods CITS5501 Software Testing and Quality Assurance Pressman, R. Software Engineering: A Practitioner s Approach. Chapter 28. McGraw-Hill, 2005 The Science of Programming, David Gries, 1981

More information

Outline. What is semantics? Denotational semantics. Semantics of naming. What is semantics? 2 / 21

Outline. What is semantics? Denotational semantics. Semantics of naming. What is semantics? 2 / 21 Semantics 1 / 21 Outline What is semantics? Denotational semantics Semantics of naming What is semantics? 2 / 21 What is the meaning of a program? Recall: aspects of a language syntax: the structure of

More information

A Hoare Logic Contract Theory: An Exercise in Denotational Semantics

A Hoare Logic Contract Theory: An Exercise in Denotational Semantics A Hoare Logic Contract Theory: An Exercise in Denotational Semantics Dilian Gurov and Jonas Westman Abstract We sketch a simple theory of Hoare logic contracts for programs with procedures, presented in

More information

Basic Verification Strategy

Basic Verification Strategy ormal Verification Basic Verification Strategy compare behavior to intent System Model of system behavior intent Verifier results Intent Usually, originates with requirements, refined through design and

More information

A short manual for the tool Accumulator

A short manual for the tool Accumulator A short manual for the tool Accumulator ZHAO Jianhua State Key Laboratory of Novel Software Technology Dept. of Computer Sci. and Tech. Nanjing University Nanjing, Jiangsu, P.R.China 210093 zhaojh@nju.edu.cn

More information

JML tool-supported specification for Java Erik Poll Radboud University Nijmegen

JML tool-supported specification for Java Erik Poll Radboud University Nijmegen JML tool-supported specification for Java Erik Poll Radboud University Nijmegen Erik Poll - JML p.1/41 Overview The specification language JML Tools for JML, in particular runtime assertion checking using

More information

3.4 Deduction and Evaluation: Tools Conditional-Equational Logic

3.4 Deduction and Evaluation: Tools Conditional-Equational Logic 3.4 Deduction and Evaluation: Tools 3.4.1 Conditional-Equational Logic The general definition of a formal specification from above was based on the existence of a precisely defined semantics for the syntax

More information

Software Quality Assurance

Software Quality Assurance Software Quality Assurance Every week we see new examples of: computer systems error/failure Here are some examples, taken from different industries Airport chaos after computer crash By Vanessa Allen,

More information