(La méthode Event-B) Proof. Thanks to Jean-Raymond Abrial. Language of Predicates.

Size: px
Start display at page:

Download "(La méthode Event-B) Proof. Thanks to Jean-Raymond Abrial. Language of Predicates."

Transcription

1 CSC 4504 : Langages formels et applications (La méthode Event-B) J Paul Gibson, A207 paul.gibson@it-sudparis.eu Proof Thanks to Jean-Raymond Abrial 2009: J Paul Gibson T&MSP-CSC 4504 : Langages formels et applications Event-B/Proof.1 Language of Predicates 2009: J Paul Gibson T&MSP-CSC 4504 : Langages formels et applications Event-B/Proof.2

2 Language of Predicates: Classical Results 2009: J Paul Gibson T&MSP-CSC 4504 : Langages formels et applications Event-B/Proof.3 Language of Predicates: Classical Results 2009: J Paul Gibson T&MSP-CSC 4504 : Langages formels et applications Event-B/Proof.4

3 Language of Predicates: Classical Results 2009: J Paul Gibson T&MSP-CSC 4504 : Langages formels et applications Event-B/Proof.5 Language of Predicates: Classical Results 2009: J Paul Gibson T&MSP-CSC 4504 : Langages formels et applications Event-B/Proof.6

4 Language of Predicates: Classical Results 2009: J Paul Gibson T&MSP-CSC 4504 : Langages formels et applications Event-B/Proof.7 Language of Predicates: Refining the language 2009: J Paul Gibson T&MSP-CSC 4504 : Langages formels et applications Event-B/Proof.8

5 Predicates & Expressions A Predicate is a formal text that can be PROVED An Expression DENOTES AN OBJECT. A Predicate denotes NOTHING. An Expression CANNOT BE PROVED Predicates and Expressions are INCOMPATIBLE. 2009: J Paul Gibson T&MSP-CSC 4504 : Langages formels et applications Event-B/Proof.9 VARIABLES, PROPOSITIONS AND PREDICATES 2009: J Paul Gibson T&MSP-CSC 4504 : Langages formels et applications Event-B/Proof.10

6 WHAT CAN WE DO WITH A PREDICATE? 2009: J Paul Gibson T&MSP-CSC 4504 : Langages formels et applications Event-B/Proof.11 SUBSTITUTION 2009: J Paul Gibson T&MSP-CSC 4504 : Langages formels et applications Event-B/Proof.12

7 UNIVERSAL QUANTIFICATION 2009: J Paul Gibson T&MSP-CSC 4504 : Langages formels et applications Event-B/Proof.13 Well-formedness Each occurrence of an identifier in a formula (that is a predicate or an expression) can be either free or bound. Intuitively, a free occurrence of an identifier refers to a declaration of that identifier in a scope outside of the formula, while a bound occurrence corresponds to a local declaration introduced by a quantifier in the formula itself. For a formula to be considered well-formed, we ask that, beyond being syntactically correct, it also satisfies the two following conditions: 1. Any identifier that occurs in the formula, should have only free occurrences or bound occurrences, but not both. 2. Any identifier that occurs bound in the formula, should be bound in exactly one place (i.e., by only one quantifier). 2009: J Paul Gibson T&MSP-CSC 4504 : Langages formels et applications Event-B/Proof.14

8 Well-formedness: checking automatically There are pages of rules for checking this on the abstract syntax of Event-B expressions. For example: 2009: J Paul Gibson T&MSP-CSC 4504 : Langages formels et applications Event-B/Proof.15 Type Checking Type checking consists of checking, statically, that a formula is meaningful in a certain context. For that, we associate a type with each expression that occurs in a formula. This type is the set of all values that the expression can take. Then, we check that the formula abides by some type checking rules. Those rules enforce that the operators used can be meaningful. Unfortunately, type checking, as it is a static check, cannot by itself prove that a formula is meaningful. For some operators, like integer division, we will also need to check some additional dynamic constraints (e.g., that the denominator is not zero). 2009: J Paul Gibson T&MSP-CSC 4504 : Langages formels et applications Event-B/Proof.16

9 Type Checking A type denotes the set of values that an expression can take. Moreover, we want this set to be derived statically, based on the form of the expression and the context in which it appears. As a consequence, a type can take one of the three following forms: 2009: J Paul Gibson T&MSP-CSC 4504 : Langages formels et applications Event-B/Proof.17 Type Checking A type variable is a meta-variable that can denote any type. We shall use lowercase Greek letters to denote type variables. A typing environment represents the context in which a formula is to be type checked. A typing environment is a partial function from the set of all identifiers to the set of all possible types. For instance, the typing environment 2009: J Paul Gibson T&MSP-CSC 4504 : Langages formels et applications Event-B/Proof.18

10 Type Checking - Rules There are pages of rules for checking this on the abstract syntax of Event-B expressions. For example: 2009: J Paul Gibson T&MSP-CSC 4504 : Langages formels et applications Event-B/Proof.19 Type Checking Rules (Example) 2009: J Paul Gibson T&MSP-CSC 4504 : Langages formels et applications Event-B/Proof.20

11 Dynamic Checking Static checks are not enough to ensure that a formula is meaningful. For instance, expression x y passes all the static checks described above, nevertheless it is meaningless if y is zero. The aim of dynamic checking is to detect these kind of meaningless formulas. This is done by generating (and then proving) some welldefinedness lemma. 2009: J Paul Gibson T&MSP-CSC 4504 : Langages formels et applications Event-B/Proof.21 Dynamic Checking (Well-definedness WD) WD lemmas for predicates 2009: J Paul Gibson T&MSP-CSC 4504 : Langages formels et applications Event-B/Proof.22

12 Dynamic Checking (Well-definedness WD) WD lemmas for binary and unary expressions 2009: J Paul Gibson T&MSP-CSC 4504 : Langages formels et applications Event-B/Proof.23 Dynamic Checking (Well-definedness WD) WD lemmas for other expressions 2009: J Paul Gibson T&MSP-CSC 4504 : Langages formels et applications Event-B/Proof.24

13 Inference Rules: for (automated) reasoning Ich wollte zunächst einmal einen Formalismus aufstellen, der dem wirklichen Schließen möglichst nahe kommt. So ergab sich ein Kalkül des natürlichen Schließens. ( First I wished to construct a formalism that comes as close as possible to actual reasoning. Thus arose a "calculus of natural deduction".) Gentzen, Untersuchungen über das logische Schließen (Mathematische Zeitschrift 39, pp , 1935) 2009: J Paul Gibson T&MSP-CSC 4504 : Langages formels et applications Event-B/Proof.25 Inference Rules: for (automated) reasoning Antécédent Conséquent nom Tabular Notation 2009: J Paul Gibson T&MSP-CSC 4504 : Langages formels et applications Event-B/Proof.26

14 Inference Rules: for (automated) reasoning 2009: J Paul Gibson T&MSP-CSC 4504 : Langages formels et applications Event-B/Proof.27 Inference Rules: for (automated) reasoning Les règles d inférence pour ^ 2009: J Paul Gibson T&MSP-CSC 4504 : Langages formels et applications Event-B/Proof.28

15 Inference Rules: for (automated) reasoning Les règles d inférence pour ^ 2009: J Paul Gibson T&MSP-CSC 4504 : Langages formels et applications Event-B/Proof.29 Inference Rules: for (automated) reasoning Les règles d inférence pour règles de contradiction ( reductio ad absurdum ) 2009: J Paul Gibson T&MSP-CSC 4504 : Langages formels et applications Event-B/Proof.30

16 Inference Rules: for (automated) reasoning Une preuve ( à la main) 2009: J Paul Gibson T&MSP-CSC 4504 : Langages formels et applications Event-B/Proof.31 Principe général d un prouveur de prédicats On procède par induction sur la syntaxe du but P d un séquent HYP - P. règles appliqué en arrière (backward). On ne monte en hypothèse (utilisation de DED) que des prédicats simples (pas de ^, =>,...) ou prédicats quantifiés universellement ( ) et normalisés on s arrête avec un axiome ou sur HYP - FAUX en cherchant une contradiction dans les hypothèses. sinon on relance une preuve en cherchant de nouvelles instanciations pour les variables des prédicats quantifiés (filtre + unification). 2009: J Paul Gibson T&MSP-CSC 4504 : Langages formels et applications Event-B/Proof.32

17 Règles d un prouveur de prédicats (génériques) opération générique 2009: J Paul Gibson T&MSP-CSC 4504 : Langages formels et applications Event-B/Proof.33 Règles d un prouveur de prédicats (^) générique Instantiation with /\ 2009: J Paul Gibson T&MSP-CSC 4504 : Langages formels et applications Event-B/Proof.34

18 Règles d un prouveur de prédicats (=>) => générique Tactique gagnante: On utilise =>4 en dernier 2009: J Paul Gibson T&MSP-CSC 4504 : Langages formels et applications Event-B/Proof.35 Règles d un prouveur de prédicats (not) générique 2009: J Paul Gibson T&MSP-CSC 4504 : Langages formels et applications Event-B/Proof.36

19 Règles d un prouveur de prédicats (les axioms) 2009: J Paul Gibson T&MSP-CSC 4504 : Langages formels et applications Event-B/Proof.37 Les prédicats quantifiés 2009: J Paul Gibson T&MSP-CSC 4504 : Langages formels et applications Event-B/Proof.38

20 Event-B is heavily influenced by Floyd-Hoare logic Floyd-Hoare Logic is a method of reasoning mathematically about imperative programs. It is the basis of most mechanized program verification systems Tony Hoare introduced the notation {P} C {Q}, called a partial correctness specification for specifying what a program does, where: C is a program (code) from the programming language whose programs are being specified P and Q are conditions on the program variables used in C 2009: J Paul Gibson T&MSP-CSC 4504 : Langages formels et applications Event-B/Proof.39 Meaning of Hoare's Notation {P} C {Q} is true if whenever C is executed in a state satisfying P and if the execution of C terminates then the state in which C terminates satisfies Q Example: {X = 1} X := X + 1 {X = 2} P is the condition that the value of X is 1 Q is the condition that the value of X is 2 C is the assignment command X := X + 1 (i.e. `X becomes X + 1') {X = 1} X := X + 1 {X = 2} is clearly true {X = 1} X := X + 1 {X = 3} is clearly false BE CAREUL with partial correctness: {X = 1} WHILE true do skip {Y=3} is true 2009: J Paul Gibson T&MSP-CSC 4504 : Langages formels et applications Event-B/Proof.40

21 Total Correctness Informally: Total correctness = Termination + Partial correctness Total correctness is the ultimate goal It is usually easier to show partial correctness and termination separately Termination is usually straightforward to show, but there are examples where it is not, e.g.: no one knows whether the program below terminates for all values of X WHILE X > 1 DO IF ODD(X) THEN X := (3 X) + 1 ELSE X := X DIV 2 Where the expression X DIV 2 evaluates to the result of rounding down X/2 to a whole number 2009: J Paul Gibson T&MSP-CSC 4504 : Langages formels et applications Event-B/Proof.41 Specification can be Tricky "The program must set Y to the maximum of X and Y" [True] C [Y = max(x, Y)] A suitable program (C)?: IF X >= Y THEN Y := X ELSE SKIP Another? IF X >= Y THEN X := Y ELSE SKIP Or even? Y := X WARNING: Later we will be able to prove that all these programs are "correct" WHY?: The postcondition "Y = max(x, Y)" says "Y is the maximum of X and Y in the final state" 2009: J Paul Gibson T&MSP-CSC 4504 : Langages formels et applications Event-B/Proof.42

22 Syntax: SKIP Semantics: the state is unchanged The SKIP Axiom : SKIP: possibly the simplest axiomatisation - {P} SKIP {P} It is an axiom schema P can be instantiated with arbitrary predicate calculus formulae (statements) Instances of the SKIP axiom are: - {Y = 2} SKIP {Y = 2} - {True} SKIP {True} - {R = X + (Y Q)} SKIP {R = X + (Y Q)} 2009: J Paul Gibson T&MSP-CSC 4504 : Langages formels et applications Event-B/Proof.43 Substitution Notation and assignment axiom: the most difficult axiomatisation Define P [E/V ] to mean the result of replacing all occurrences of V in P by E read P [E/V ] as `P with E for V ' for example: (X + 1 > X)[Y + Z/X] = ((Y + Z) + 1 > Y + Z) Think of this notation as the `cancellation law': V [E/V ] = E which is analogous to the cancellation property of fractions: v (e/v) = e The Assignment Axiom - {P [E/V ]} V := E {P} Where V is any variable, E is any expression, P is any statement and the notation P [E/V ] denotes the result of substituting the term E for all occurrences of the variable V in the statement P. Example: - {X + 1 = n + 1} X := X + 1 {X = n + 1} - can be proven 2009: J Paul Gibson T&MSP-CSC 4504 : Langages formels et applications Event-B/Proof.44

23 Precondition Strengthening is a typical development step Recall that - S 1,..., - Sn -S means - S can be deduced from - S 1,..., - Sn Using this notation, the rule of precondition strengthening is: - P => P, -{P } C {Q} - {P} C {Q} 2009: J Paul Gibson T&MSP-CSC 4504 : Langages formels et applications Event-B/Proof.45 Postcondition Weakening Just as the previous rule allows the precondition of a partial correctness specification to be strengthened, the following one allows us to weaken the postcondition: - {P} C {Q }, - Q => Q - {P} C {Q} The rules precondition strengthening and postcondition weakening are sometimes called the rules of consequence 2009: J Paul Gibson T&MSP-CSC 4504 : Langages formels et applications Event-B/Proof.46

24 Existential Quantification 2009: J Paul Gibson T&MSP-CSC 4504 : Langages formels et applications Event-B/Proof.47 Comparing the Quantification Rules 2009: J Paul Gibson T&MSP-CSC 4504 : Langages formels et applications Event-B/Proof.48

25 Classical Results 2009: J Paul Gibson T&MSP-CSC 4504 : Langages formels et applications Event-B/Proof.49 Classical Results 2009: J Paul Gibson T&MSP-CSC 4504 : Langages formels et applications Event-B/Proof.50

26 Refining our Language: Equality (with classical results) 2009: J Paul Gibson T&MSP-CSC 4504 : Langages formels et applications Event-B/Proof.51 Refining our Language: Set Theory 2009: J Paul Gibson T&MSP-CSC 4504 : Langages formels et applications Event-B/Proof.52

27 Basic Set Operator Memberships (Axioms) 2009: J Paul Gibson T&MSP-CSC 4504 : Langages formels et applications Event-B/Proof.53 Set Inclusion and Extensionality Axiom 2009: J Paul Gibson T&MSP-CSC 4504 : Langages formels et applications Event-B/Proof.54

28 Classical Results with Relation Operators Relations (like r, q and p) between Sets (like S) containing elements (like a and b) 2009: J Paul Gibson T&MSP-CSC 4504 : Langages formels et applications Event-B/Proof.55 Applying a Function 2009: J Paul Gibson T&MSP-CSC 4504 : Langages formels et applications Event-B/Proof.56

29 Invariant Preservation 2009: J Paul Gibson T&MSP-CSC 4504 : Langages formels et applications Event-B/Proof.57 Invariant Preservation 2009: J Paul Gibson T&MSP-CSC 4504 : Langages formels et applications Event-B/Proof.58

30 Invariant Preservation 2009: J Paul Gibson T&MSP-CSC 4504 : Langages formels et applications Event-B/Proof.59 Invariant Preservation: the rules 2009: J Paul Gibson T&MSP-CSC 4504 : Langages formels et applications Event-B/Proof.60

31 Invariant Preservation: the rules 2009: J Paul Gibson T&MSP-CSC 4504 : Langages formels et applications Event-B/Proof.61 Invariant Preservation: the rules 2009: J Paul Gibson T&MSP-CSC 4504 : Langages formels et applications Event-B/Proof.62

32 Deadlock Freedom 2009: J Paul Gibson T&MSP-CSC 4504 : Langages formels et applications Event-B/Proof.63 Event interpretation for refinement proofs The execution of this event is enabled whenever there exist some values x and y such that the guard P is true, then z is assigned x+y 2009: J Paul Gibson T&MSP-CSC 4504 : Langages formels et applications Event-B/Proof.64

33 Event interpretation Example This event is always enabled (there always exists a natural number x > 10) The result of the event is that z is assigned an arbitrary natural number greater than 10. The event is equivalet to 2009: J Paul Gibson T&MSP-CSC 4504 : Langages formels et applications Event-B/Proof.65 Refinement is used to transform an abstract machine into a concrete machine which does the same computation, but possibly using a different data structure and/or different internal execution can be refined (possibly) into Also if in the abstract machine we have a nondeterministic event, then this could be refined into a deterministic one in the concrete machines : 2009: J Paul Gibson T&MSP-CSC 4504 : Langages formels et applications Event-B/Proof.66

34 2009: J Paul Gibson T&MSP-CSC 4504 : Langages formels et applications Event-B/Proof : J Paul Gibson T&MSP-CSC 4504 : Langages formels et applications Event-B/Proof.68

35 2009: J Paul Gibson T&MSP-CSC 4504 : Langages formels et applications Event-B/Proof : J Paul Gibson T&MSP-CSC 4504 : Langages formels et applications Event-B/Proof.70

36 2009: J Paul Gibson T&MSP-CSC 4504 : Langages formels et applications Event-B/Proof.71 Names of context proof obligations: 2009: J Paul Gibson T&MSP-CSC 4504 : Langages formels et applications Event-B/Proof.72

37 Names of machine proof obligations: 2009: J Paul Gibson T&MSP-CSC 4504 : Langages formels et applications Event-B/Proof.73 Names of refinement proof obligations: 2009: J Paul Gibson T&MSP-CSC 4504 : Langages formels et applications Event-B/Proof.74

38 Names of variant proof obligations: 2009: J Paul Gibson T&MSP-CSC 4504 : Langages formels et applications Event-B/Proof.75 Names of Witness proof obligations: 2009: J Paul Gibson T&MSP-CSC 4504 : Langages formels et applications Event-B/Proof.76

39 Names of Deadlock Freeness proof obligations: At the moment, the deadlock freeness proof obligation generation is incomplete. If you need it, you can generate it yourself as a theorem saying the the disjunction of the abstract guards imply the disjunction of the concrete guards. 2009: J Paul Gibson T&MSP-CSC 4504 : Langages formels et applications Event-B/Proof.77 The Automatic Post-tactic: Rewrite rules The following rewrite rules are applied automatically in a systematic fashion from left to right either in the goal or in the selected hypotheses. 2009: J Paul Gibson T&MSP-CSC 4504 : Langages formels et applications Event-B/Proof.78

40 The Automatic Post-tactic: Rewrite rules 2009: J Paul Gibson T&MSP-CSC 4504 : Langages formels et applications Event-B/Proof.79 The Automatic Post-tactic: Rewrite rules 2009: J Paul Gibson T&MSP-CSC 4504 : Langages formels et applications Event-B/Proof.80

41 The Automatic Post-tactic: Rewrite rules 2009: J Paul Gibson T&MSP-CSC 4504 : Langages formels et applications Event-B/Proof.81 The Automatic Post-tactic: Rewrite rules 2009: J Paul Gibson T&MSP-CSC 4504 : Langages formels et applications Event-B/Proof.82

42 The Automatic Post-tactic: Rewrite rules 2009: J Paul Gibson T&MSP-CSC 4504 : Langages formels et applications Event-B/Proof.83 The Automatic Post-tactic: Rewrite rules 2009: J Paul Gibson T&MSP-CSC 4504 : Langages formels et applications Event-B/Proof.84

43 The Automatic Post-tactic: Rewrite rules 2009: J Paul Gibson T&MSP-CSC 4504 : Langages formels et applications Event-B/Proof.85 Automatic inference rules The following inference rules are applied automatically in a systematic fashion at the end of each proof step. They have the following possible effects: they discharge the goal, they simplify the goal and add a selected hypothesis, they simplify the goal by decomposing it into several simpler goals, they simplify a selected hypothesis, they simplify a selected hypothesis by decomposing it into several simpler selected hypotheses. 2009: J Paul Gibson T&MSP-CSC 4504 : Langages formels et applications Event-B/Proof.86

44 Automatic inference rules 2009: J Paul Gibson T&MSP-CSC 4504 : Langages formels et applications Event-B/Proof.87 Automatic inference rules 2009: J Paul Gibson T&MSP-CSC 4504 : Langages formels et applications Event-B/Proof.88

45 Automatic inference rules 2009: J Paul Gibson T&MSP-CSC 4504 : Langages formels et applications Event-B/Proof.89 Automatic inference rules 2009: J Paul Gibson T&MSP-CSC 4504 : Langages formels et applications Event-B/Proof.90

46 Automatic inference rules 2009: J Paul Gibson T&MSP-CSC 4504 : Langages formels et applications Event-B/Proof.91 Preferences for the Auto-prover The auto-prover can be configured by means of a preference page, which can be obtained as follows: press the Window button on the top tooolbar. On the coming menu, press the Preferences button. On the coming menu, press the Event-B menue, then the Sequent Prover, and finally the Auto-Tactic button. This yields the following window: 2009: J Paul Gibson T&MSP-CSC 4504 : Langages formels et applications Event-B/Proof.92

47 Interactive inference rules: through the red buttons in prover window 2009: J Paul Gibson T&MSP-CSC 4504 : Langages formels et applications Event-B/Proof.93 Interactive inference rules: through the red buttons in prover window many more 2009: J Paul Gibson T&MSP-CSC 4504 : Langages formels et applications Event-B/Proof.94

48 Interactive inference rules: through the red buttons in prover window 2009: J Paul Gibson T&MSP-CSC 4504 : Langages formels et applications Event-B/Proof.95

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

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

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

Program verification using Hoare Logic¹

Program verification using Hoare Logic¹ Program verification using Hoare Logic¹ Automated Reasoning - Guest Lecture Petros Papapanagiotou Part 2 of 2 ¹Contains material from Mike Gordon s slides: Previously on Hoare Logic A simple while language

More 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

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

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 Sequent Calculus

Lecture Notes on Sequent Calculus Lecture Notes on Sequent Calculus 15-816: Modal Logic Frank Pfenning Lecture 8 February 9, 2010 1 Introduction In this lecture we present the sequent calculus and its theory. The sequent calculus was originally

More information

Propositions and Proofs

Propositions and Proofs Chapter 2 Propositions and Proofs The goal of this chapter is to develop the two principal notions of logic, namely propositions and proofs There is no universal agreement about the proper foundations

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

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

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

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

Program Analysis Part I : Sequential Programs

Program Analysis Part I : Sequential Programs Program Analysis Part I : Sequential Programs IN5170/IN9170 Models of concurrency Program Analysis, lecture 5 Fall 2018 26. 9. 2018 2 / 44 Program correctness Is my program correct? Central question for

More 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

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

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

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

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

Logic and Computation

Logic and Computation Logic and Computation Brigitte Pientka School of Computer Science McGill University Montreal, Canada These course notes have been developed by Prof. B. Pientka for COMP527:Logic and Computation. Part of

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

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

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

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

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

Knowledge-Based Systems and Deductive Databases

Knowledge-Based Systems and Deductive Databases Knowledge-Based Systems and Deductive Databases Christoph Lofi Institut für Informationssysteme Technische Universität Braunschweig http://www.ifis.cs.tu-bs.de 3. Models 3.1 Logical Models 3.2 Deductive

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

3 Propositional Logic

3 Propositional Logic 3 Propositional Logic 3.1 Syntax 3.2 Semantics 3.3 Equivalence and Normal Forms 3.4 Proof Procedures 3.5 Properties Propositional Logic (25th October 2007) 1 3.1 Syntax Definition 3.0 An alphabet Σ consists

More information

Summary of Event-B Proof Obligations

Summary of Event-B Proof Obligations Summary of Event-B Proof Obligations Jean-Raymond Abrial (ETHZ) March 2008 Purpose of this Presentation 1 - Prerequisite: (1) Summary of Mathematical Notation (a quick review) (2) Summary of Event-B Notation

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

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

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

Lecture Notes on Cut Elimination

Lecture Notes on Cut Elimination Lecture Notes on Cut Elimination 15-317: Constructive Logic Frank Pfenning Lecture 10 October 5, 2017 1 Introduction The entity rule of the sequent calculus exhibits one connection between the judgments

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

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

Lecture 17: Floyd-Hoare Logic for Partial Correctness

Lecture 17: Floyd-Hoare Logic for Partial Correctness Lecture 17: Floyd-Hoare Logic for Partial Correctness Aims: To look at the following inference rules Page 1 of 9 sequence; assignment and consequence. 17.1. The Deduction System for Partial Correctness

More information

Axiomatic Semantics. Semantics of Programming Languages course. Joosep Rõõmusaare

Axiomatic Semantics. Semantics of Programming Languages course. Joosep Rõõmusaare Axiomatic Semantics Semantics of Programming Languages course Joosep Rõõmusaare 2014 Direct Proofs of Program Correctness Partial correctness properties are properties expressing that if a given program

More 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

Applied Logic for Computer Scientists. Answers to Some Exercises

Applied Logic for Computer Scientists. Answers to Some Exercises Applied Logic for Computer Scientists Computational Deduction and Formal Proofs Springer, 2017 doi: http://link.springer.com/book/10.1007%2f978-3-319-51653-0 Answers to Some Exercises Mauricio Ayala-Rincón

More information

Advanced Topics in LP and FP

Advanced Topics in LP and FP Lecture 1: Prolog and Summary of this lecture 1 Introduction to Prolog 2 3 Truth value evaluation 4 Prolog Logic programming language Introduction to Prolog Introduced in the 1970s Program = collection

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

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

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

Propositional Logic: Deductive Proof & Natural Deduction Part 1

Propositional Logic: Deductive Proof & Natural Deduction Part 1 Propositional Logic: Deductive Proof & Natural Deduction Part 1 CS402, Spring 2016 Shin Yoo Deductive Proof In propositional logic, a valid formula is a tautology. So far, we could show the validity of

More information

Inductive Predicates

Inductive Predicates Inductive Predicates Gert Smolka, Saarland University June 12, 2017 We introduce inductive predicates as they are accommodated in Coq s type theory. Our prime example is the ordering predicate for numbers,

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

Lecture Notes on Inductive Definitions

Lecture Notes on Inductive Definitions Lecture Notes on Inductive Definitions 15-312: Foundations of Programming Languages Frank Pfenning Lecture 2 September 2, 2004 These supplementary notes review the notion of an inductive definition and

More information

TR : Binding Modalities

TR : Binding Modalities City University of New York (CUNY) CUNY Academic Works Computer Science Technical Reports Graduate Center 2012 TR-2012011: Binding Modalities Sergei N. Artemov Tatiana Yavorskaya (Sidon) Follow this and

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

Definition of a Mathematical Language Together with its Proof System in Event-B

Definition of a Mathematical Language Together with its Proof System in Event-B Definition of a Mathematical Language Together with its Proof System in Event-B Jean-Raymond Abrial Marseille jrabrial@neuf.fr 1 Introduction Our application domain with the B Method and Event-B is the

More information

Notation for Logical Operators:

Notation for Logical Operators: Notation for Logical Operators: always true always false... and...... or... if... then...... if-and-only-if... x:x p(x) x:x p(x) for all x of type X, p(x) there exists an x of type X, s.t. p(x) = is equal

More information

3. Only sequences that were formed by using finitely many applications of rules 1 and 2, are propositional formulas.

3. Only sequences that were formed by using finitely many applications of rules 1 and 2, are propositional formulas. 1 Chapter 1 Propositional Logic Mathematical logic studies correct thinking, correct deductions of statements from other statements. Let us make it more precise. A fundamental property of a statement is

More information

MAI0203 Lecture 7: Inference and Predicate Calculus

MAI0203 Lecture 7: Inference and Predicate Calculus MAI0203 Lecture 7: Inference and Predicate Calculus Methods of Artificial Intelligence WS 2002/2003 Part II: Inference and Knowledge Representation II.7 Inference and Predicate Calculus MAI0203 Lecture

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

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

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

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

Fundamentals of Software Engineering

Fundamentals of Software Engineering Fundamentals of Software Engineering First-Order Logic Ina Schaefer Institute for Software Systems Engineering TU Braunschweig, Germany Slides by Wolfgang Ahrendt, Richard Bubel, Reiner Hähnle (Chalmers

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

NICTA Advanced Course. Theorem Proving Principles, Techniques, Applications

NICTA Advanced Course. Theorem Proving Principles, Techniques, Applications NICTA Advanced Course Theorem Proving Principles, Techniques, Applications λ 1 CONTENT Intro & motivation, getting started with Isabelle Foundations & Principles Lambda Calculus Higher Order Logic, natural

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

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

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: Part II - Syntax & Proofs 0-0

Propositional Logic: Part II - Syntax & Proofs 0-0 Propositional Logic: Part II - Syntax & Proofs 0-0 Outline Syntax of Propositional Formulas Motivating Proofs Syntactic Entailment and Proofs Proof Rules for Natural Deduction Axioms, theories and theorems

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

CHAPTER 1. MATHEMATICAL LOGIC 1.1 Fundamentals of Mathematical Logic

CHAPTER 1. MATHEMATICAL LOGIC 1.1 Fundamentals of Mathematical Logic CHAPER 1 MAHEMAICAL LOGIC 1.1 undamentals of Mathematical Logic Logic is commonly known as the science of reasoning. Some of the reasons to study logic are the following: At the hardware level the design

More information

Evaluation Driven Proof-Search in Natural Deduction Calculi for Intuitionistic Propositional Logic

Evaluation Driven Proof-Search in Natural Deduction Calculi for Intuitionistic Propositional Logic Evaluation Driven Proof-Search in Natural Deduction Calculi for Intuitionistic Propositional Logic Mauro Ferrari 1, Camillo Fiorentini 2 1 DiSTA, Univ. degli Studi dell Insubria, Varese, Italy 2 DI, Univ.

More information

Implementing Proof Systems for the Intuitionistic Propositional Logic

Implementing Proof Systems for the Intuitionistic Propositional Logic Implementing Proof Systems for the Intuitionistic Propositional Logic Veronica Zammit Supervisor: Dr. Adrian Francalanza Faculty of ICT University of Malta May 27, 2011 Submitted in partial fulfillment

More information

Section 1.1 Propositions

Section 1.1 Propositions Set Theory & Logic Section 1.1 Propositions Fall, 2009 Section 1.1 Propositions In Chapter 1, our main goals are to prove sentences about numbers, equations or functions and to write the proofs. Definition.

More information

Fundamentals of Software Engineering

Fundamentals of Software Engineering Fundamentals of Software Engineering First-Order Logic Ina Schaefer Institute for Software Systems Engineering TU Braunschweig, Germany Slides by Wolfgang Ahrendt, Richard Bubel, Reiner Hähnle (Chalmers

More information

Lecture Notes on From Rules to Propositions

Lecture Notes on From Rules to Propositions Lecture Notes on From Rules to Propositions 15-816: Linear Logic Frank Pfenning Lecture 2 January 18, 2012 We review the ideas of ephemeral truth and linear inference with another example from graph theory:

More information

Lecture Notes on Cut Elimination

Lecture Notes on Cut Elimination Lecture Notes on Cut Elimination 15-816: Substructural Logics Frank Pfenning Lecture 4 September 8, 2016 We first present some additional examples illustrating ordered inference that capture computations

More information

Introduction to Metalogic

Introduction to Metalogic Philosophy 135 Spring 2008 Tony Martin Introduction to Metalogic 1 The semantics of sentential logic. The language L of sentential logic. Symbols of L: Remarks: (i) sentence letters p 0, p 1, p 2,... (ii)

More information

CS1021. Why logic? Logic about inference or argument. Start from assumptions or axioms. Make deductions according to rules of reasoning.

CS1021. Why logic? Logic about inference or argument. Start from assumptions or axioms. Make deductions according to rules of reasoning. 3: Logic Why logic? Logic about inference or argument Start from assumptions or axioms Make deductions according to rules of reasoning Logic 3-1 Why logic? (continued) If I don t buy a lottery ticket on

More information

INDUCTION AND RECURSION

INDUCTION AND RECURSION INDUCTION AND RECURSION Jorma K. Mattila LUT, Department of Mathematics and Physics 1 Induction on Basic and Natural Numbers 1.1 Introduction In its most common form, mathematical induction or, as it is

More information

LOGIC PROPOSITIONAL REASONING

LOGIC PROPOSITIONAL REASONING LOGIC PROPOSITIONAL REASONING WS 2017/2018 (342.208) Armin Biere Martina Seidl biere@jku.at martina.seidl@jku.at Institute for Formal Models and Verification Johannes Kepler Universität Linz Version 2018.1

More information

Propositional logic (revision) & semantic entailment. p. 1/34

Propositional logic (revision) & semantic entailment. p. 1/34 Propositional logic (revision) & semantic entailment p. 1/34 Reading The background reading for propositional logic is Chapter 1 of Huth/Ryan. (This will cover approximately the first three lectures.)

More information

Propositional Calculus - Soundness & Completeness of H

Propositional Calculus - Soundness & Completeness of H Propositional Calculus - Soundness & Completeness of H Moonzoo Kim CS Dept. KAIST moonzoo@cs.kaist.ac.kr 1 Review Goal of logic To check whether given a formula Á is valid To prove a given formula Á `

More information

Lecture Notes on Inductive Definitions

Lecture Notes on Inductive Definitions Lecture Notes on Inductive Definitions 15-312: Foundations of Programming Languages Frank Pfenning Lecture 2 August 28, 2003 These supplementary notes review the notion of an inductive definition and give

More information

Proving Completeness for Nested Sequent Calculi 1

Proving Completeness for Nested Sequent Calculi 1 Proving Completeness for Nested Sequent Calculi 1 Melvin Fitting abstract. Proving the completeness of classical propositional logic by using maximal consistent sets is perhaps the most common method there

More information

Automata-Theoretic Model Checking of Reactive Systems

Automata-Theoretic Model Checking of Reactive Systems Automata-Theoretic Model Checking of Reactive Systems Radu Iosif Verimag/CNRS (Grenoble, France) Thanks to Tom Henzinger (IST, Austria), Barbara Jobstmann (CNRS, Grenoble) and Doron Peled (Bar-Ilan University,

More information

First-Order Logic. Chapter Overview Syntax

First-Order Logic. Chapter Overview Syntax Chapter 10 First-Order Logic 10.1 Overview First-Order Logic is the calculus one usually has in mind when using the word logic. It is expressive enough for all of mathematics, except for those concepts

More information

On the Complexity of the Reflected Logic of Proofs

On the Complexity of the Reflected Logic of Proofs On the Complexity of the Reflected Logic of Proofs Nikolai V. Krupski Department of Math. Logic and the Theory of Algorithms, Faculty of Mechanics and Mathematics, Moscow State University, Moscow 119899,

More information

3.2 Reduction 29. Truth. The constructor just forms the unit element,. Since there is no destructor, there is no reduction rule.

3.2 Reduction 29. Truth. The constructor just forms the unit element,. Since there is no destructor, there is no reduction rule. 32 Reduction 29 32 Reduction In the preceding section, we have introduced the assignment of proof terms to natural deductions If proofs are programs then we need to explain how proofs are to be executed,

More information

Chapter 1 Elementary Logic

Chapter 1 Elementary Logic 2017-2018 Chapter 1 Elementary Logic The study of logic is the study of the principles and methods used in distinguishing valid arguments from those that are not valid. The aim of this chapter is to help

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

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

Models of Computation,

Models of Computation, Models of Computation, 2010 1 Induction We use a lot of inductive techniques in this course, both to give definitions and to prove facts about our semantics So, it s worth taking a little while to set

More information

Introduction to Logic in Computer Science: Autumn 2006

Introduction to Logic in Computer Science: Autumn 2006 Introduction to Logic in Computer Science: Autumn 2006 Ulle Endriss Institute for Logic, Language and Computation University of Amsterdam Ulle Endriss 1 Plan for Today Today s class will be an introduction

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 Examples & Proof Theory. COS 441 Slides 11

Hoare Examples & Proof Theory. COS 441 Slides 11 Hoare Examples & Proof Theory COS 441 Slides 11 The last several lectures: Agenda Denotational semantics of formulae in Haskell Reasoning using Hoare Logic This lecture: Exercises A further introduction

More information

Propositional Logic: Syntax

Propositional Logic: Syntax Logic Logic is a tool for formalizing reasoning. There are lots of different logics: probabilistic logic: for reasoning about probability temporal logic: for reasoning about time (and programs) epistemic

More information

Intelligent Agents. First Order Logic. Ute Schmid. Cognitive Systems, Applied Computer Science, Bamberg University. last change: 19.

Intelligent Agents. First Order Logic. Ute Schmid. Cognitive Systems, Applied Computer Science, Bamberg University. last change: 19. Intelligent Agents First Order Logic Ute Schmid Cognitive Systems, Applied Computer Science, Bamberg University last change: 19. Mai 2015 U. Schmid (CogSys) Intelligent Agents last change: 19. Mai 2015

More information

Software Engineering using Formal Methods

Software Engineering using Formal Methods Software Engineering using Formal Methods First-Order Logic Wolfgang Ahrendt 26th September 2013 SEFM: First-Order Logic 130926 1 / 53 Install the KeY-Tool... KeY used in Friday s exercise Requires: Java

More information

arxiv: v1 [cs.pl] 5 Apr 2017

arxiv: v1 [cs.pl] 5 Apr 2017 arxiv:1704.01814v1 [cs.pl] 5 Apr 2017 Bilateral Proofs of Safety and Progress Properties of Concurrent Programs Jayadev Misra University of Texas at Austin, misra@utexas.edu April 5, 2017 Abstract This

More information

Unifying Theories of Programming

Unifying Theories of Programming 1&2 Unifying Theories of Programming Unifying Theories of Programming 3&4 Theories Unifying Theories of Programming designs predicates relations reactive CSP processes Jim Woodcock University of York May

More information

TECHNISCHE UNIVERSITEIT EINDHOVEN Faculteit Wiskunde en Informatica. Final examination Logic & Set Theory (2IT61/2IT07/2IHT10) (correction model)

TECHNISCHE UNIVERSITEIT EINDHOVEN Faculteit Wiskunde en Informatica. Final examination Logic & Set Theory (2IT61/2IT07/2IHT10) (correction model) TECHNISCHE UNIVERSITEIT EINDHOVEN Faculteit Wiskunde en Informatica Final examination Logic & Set Theory (2IT61/2IT07/2IHT10) (correction model) Thursday October 29, 2015, 9:00 12:00 hrs. (2) 1. Determine

More information

3 The language of proof

3 The language of proof 3 The language of proof After working through this section, you should be able to: (a) understand what is asserted by various types of mathematical statements, in particular implications and equivalences;

More information

Automated Synthesis of Tableau Calculi

Automated Synthesis of Tableau Calculi Automated Synthesis of Tableau Calculi Renate A. Schmidt 1 and Dmitry Tishkovsky 1 School of Computer Science, The University of Manchester Abstract This paper presents a method for synthesising sound

More information

Consequence Relations and Natural Deduction

Consequence Relations and Natural Deduction Consequence Relations and Natural Deduction Joshua D. Guttman Worcester Polytechnic Institute September 9, 2010 Contents 1 Consequence Relations 1 2 A Derivation System for Natural Deduction 3 3 Derivations

More information