Gerwin Klein, June Andronick, Ramana Kumar S2/2016

Size: px
Start display at page:

Download "Gerwin Klein, June Andronick, Ramana Kumar S2/2016"

Transcription

1 COMP4161: Advanced Topics in Software Verification {} Gerwin Klein, June Andronick, Ramana Kumar S2/2016 data61.csiro.au

2 Content Intro & motivation, getting started [1] Foundations & Principles Lambda Calculus, natural deduction [1,2] Higher Order Logic [3 a ] Term rewriting [4] Proof & Specification Techniques Inductively defined sets, rule induction [5] Datatypes, recursion, induction [6, 7] Hoare logic, proofs about programs, C verification [8 b,9] (mid-semester break) Writing Automated Proof Methods [10] Isar, codegen, typeclasses, locales [11 c,12] a a1 due; b a2 due; c a3 due 2 COMP4161 c Data61, CSIRO: provided under Creative Commons Attribution License

3 Last Time Sets 3 COMP4161 c Data61, CSIRO: provided under Creative Commons Attribution License

4 Last Time Sets Type Definitions 3 COMP4161 c Data61, CSIRO: provided under Creative Commons Attribution License

5 Last Time Sets Type Definitions Inductive Definitions 3 COMP4161 c Data61, CSIRO: provided under Creative Commons Attribution License

6 Inductive Definitions How They Work

7 The Nat Example 0 N n N n + 1 N 5 COMP4161 c Data61, CSIRO: provided under Creative Commons Attribution License

8 The Nat Example 0 N N is the set of natural numbers IN n N n + 1 N 5 COMP4161 c Data61, CSIRO: provided under Creative Commons Attribution License

9 The Nat Example 0 N n N n + 1 N N is the set of natural numbers IN But why not the set of real numbers? 0 IR, n IR = n + 1 IR 5 COMP4161 c Data61, CSIRO: provided under Creative Commons Attribution License

10 The Nat Example 0 N n N n + 1 N N is the set of natural numbers IN But why not the set of real numbers? 0 IR, n IR = n + 1 IR IN is the smallest set that is consistent with the rules. 5 COMP4161 c Data61, CSIRO: provided under Creative Commons Attribution License

11 The Nat Example 0 N n N n + 1 N N is the set of natural numbers IN But why not the set of real numbers? 0 IR, n IR = n + 1 IR IN is the smallest set that is consistent with the rules. Why the smallest set? 5 COMP4161 c Data61, CSIRO: provided under Creative Commons Attribution License

12 The Nat Example 0 N n N n + 1 N N is the set of natural numbers IN But why not the set of real numbers? 0 IR, n IR = n + 1 IR IN is the smallest set that is consistent with the rules. Why the smallest set? Objective: no junk. Only what must be in X shall be in X. 5 COMP4161 c Data61, CSIRO: provided under Creative Commons Attribution License

13 The Nat Example 0 N n N n + 1 N N is the set of natural numbers IN But why not the set of real numbers? 0 IR, n IR = n + 1 IR IN is the smallest set that is consistent with the rules. Why the smallest set? Objective: no junk. Only what must be in X shall be in X. Gives rise to a nice proof principle (rule induction) 5 COMP4161 c Data61, CSIRO: provided under Creative Commons Attribution License

14 Formally Rules a 1 X... a n X a X define set X A with a 1,..., a n, a A Formally: 6 COMP4161 c Data61, CSIRO: provided under Creative Commons Attribution License

15 Formally Rules a 1 X... a n X a X define set X A with a 1,..., a n, a A Formally: set of rules R A set A Applying rules R to a set B: (R, X possibly infinite) 6 COMP4161 c Data61, CSIRO: provided under Creative Commons Attribution License

16 Formally Rules a 1 X... a n X a X define set X A with a 1,..., a n, a A Formally: set of rules R A set A (R, X possibly infinite) Applying rules R to a set B: ˆR B {x. H. (H, x) R H B} Example: 6 COMP4161 c Data61, CSIRO: provided under Creative Commons Attribution License

17 Formally Rules a 1 X... a n X a X define set X A with a 1,..., a n, a A Formally: set of rules R A set A (R, X possibly infinite) Applying rules R to a set B: ˆR B {x. H. (H, x) R H B} Example: R {({}, 0)} {({n}, n + 1). n IR} ˆR {3, 6, 10} = 6 COMP4161 c Data61, CSIRO: provided under Creative Commons Attribution License

18 Formally Rules a 1 X... a n X a X define set X A with a 1,..., a n, a A Formally: set of rules R A set A (R, X possibly infinite) Applying rules R to a set B: ˆR B {x. H. (H, x) R H B} Example: R {({}, 0)} {({n}, n + 1). n IR} ˆR {3, 6, 10} = {0, 4, 7, 11} 6 COMP4161 c Data61, CSIRO: provided under Creative Commons Attribution License

19 The Set Definition: B is R-closed iff ˆR B B 7 COMP4161 c Data61, CSIRO: provided under Creative Commons Attribution License

20 The Set Definition: Definition: B is R-closed iff ˆR B B X is the least R-closed subset of A This does always exist: 7 COMP4161 c Data61, CSIRO: provided under Creative Commons Attribution License

21 The Set Definition: Definition: B is R-closed iff ˆR B B X is the least R-closed subset of A This does always exist: Fact: X = {B A. B R closed} 7 COMP4161 c Data61, CSIRO: provided under Creative Commons Attribution License

22 Generation from Above A 8 COMP4161 c Data61, CSIRO: provided under Creative Commons Attribution License

23 Generation from Above A R-closed 8 COMP4161 c Data61, CSIRO: provided under Creative Commons Attribution License

24 Generation from Above A R-closed R-closed 8 COMP4161 c Data61, CSIRO: provided under Creative Commons Attribution License

25 Generation from Above A R-closed R-closed R-closed 8 COMP4161 c Data61, CSIRO: provided under Creative Commons Attribution License

26 Generation from Above A R-closed X R-closed R-closed 8 COMP4161 c Data61, CSIRO: provided under Creative Commons Attribution License

27 Rule Induction 0 N n N n + 1 N induces induction principle [[P 0; n. P n = P (n + 1)]] = x X. P x 9 COMP4161 c Data61, CSIRO: provided under Creative Commons Attribution License

28 Rule Induction 0 N n N n + 1 N induces induction principle [[P 0; n. P n = P (n + 1)]] = x X. P x In general: ({a 1,... a n }, a) R. P a 1... P a n = P a x X. P x 9 COMP4161 c Data61, CSIRO: provided under Creative Commons Attribution License

29 Why does this work? ({a 1,... a n }, a) R. P a 1... P a n = P a x X. P x ({a 1,... a n }, a) R. P a 1... P a n = P a says 10 COMP4161 c Data61, CSIRO: provided under Creative Commons Attribution License

30 Why does this work? ({a 1,... a n }, a) R. P a 1... P a n = P a x X. P x ({a 1,... a n }, a) R. P a 1... P a n = P a says {x. P x} is R-closed but: 10 COMP4161 c Data61, CSIRO: provided under Creative Commons Attribution License

31 Why does this work? ({a 1,... a n }, a) R. P a 1... P a n = P a x X. P x ({a 1,... a n }, a) R. P a 1... P a n = P a says {x. P x} is R-closed but: hence: X is the least R-closed set 10 COMP4161 c Data61, CSIRO: provided under Creative Commons Attribution License

32 Why does this work? ({a 1,... a n }, a) R. P a 1... P a n = P a x X. P x ({a 1,... a n }, a) R. P a 1... P a n = P a says {x. P x} is R-closed but: X is the least R-closed set hence: X {x. P x} which means: 10 COMP4161 c Data61, CSIRO: provided under Creative Commons Attribution License

33 Why does this work? ({a 1,... a n }, a) R. P a 1... P a n = P a x X. P x ({a 1,... a n }, a) R. P a 1... P a n = P a says {x. P x} is R-closed but: X is the least R-closed set hence: X {x. P x} which means: x X. P x 10 COMP4161 c Data61, CSIRO: provided under Creative Commons Attribution License

34 Why does this work? ({a 1,... a n }, a) R. P a 1... P a n = P a x X. P x ({a 1,... a n }, a) R. P a 1... P a n = P a says {x. P x} is R-closed but: X is the least R-closed set hence: X {x. P x} which means: x X. P x qed 10 COMP4161 c Data61, CSIRO: provided under Creative Commons Attribution License

35 Rules with side conditions a 1 X... a n X C 1... C m a X 11 COMP4161 c Data61, CSIRO: provided under Creative Commons Attribution License

36 Rules with side conditions a 1 X... a n X C 1... C m a X induction scheme: ( ({a 1,... a n }, a) R. P a 1... P a n C 1... C m {a 1,..., a n } X = P a) = x X. P x 11 COMP4161 c Data61, CSIRO: provided under Creative Commons Attribution License

37 X as Fixpoint How to compute X? 12 COMP4161 c Data61, CSIRO: provided under Creative Commons Attribution License

38 X as Fixpoint How to compute X? X = {B A. B R closed} hard to work with. Instead: 12 COMP4161 c Data61, CSIRO: provided under Creative Commons Attribution License

39 X as Fixpoint How to compute X? X = {B A. B R closed} hard to work with. Instead: view X as least fixpoint, X least set with ˆR X = X. 12 COMP4161 c Data61, CSIRO: provided under Creative Commons Attribution License

40 X as Fixpoint How to compute X? X = {B A. B R closed} hard to work with. Instead: view X as least fixpoint, X least set with ˆR X = X. Fixpoints can be approximated by iteration: X 0 = ˆR 0 {} = {} 12 COMP4161 c Data61, CSIRO: provided under Creative Commons Attribution License

41 X as Fixpoint How to compute X? X = {B A. B R closed} hard to work with. Instead: view X as least fixpoint, X least set with ˆR X = X. Fixpoints can be approximated by iteration: X 0 = ˆR 0 {} = {} X 1 = ˆR 1 {} = rules without hypotheses. 12 COMP4161 c Data61, CSIRO: provided under Creative Commons Attribution License

42 X as Fixpoint How to compute X? X = {B A. B R closed} hard to work with. Instead: view X as least fixpoint, X least set with ˆR X = X. Fixpoints can be approximated by iteration: X 0 = ˆR 0 {} = {} X 1 = ˆR 1 {} = rules without hypotheses. X n = ˆR n {} 12 COMP4161 c Data61, CSIRO: provided under Creative Commons Attribution License

43 X as Fixpoint How to compute X? X = {B A. B R closed} hard to work with. Instead: view X as least fixpoint, X least set with ˆR X = X. Fixpoints can be approximated by iteration: X 0 = ˆR 0 {} = {} X 1 = ˆR 1 {} = rules without hypotheses. X n = ˆR n {} X ω = n IN (Rn {}) = X 12 COMP4161 c Data61, CSIRO: provided under Creative Commons Attribution License

44 Generation from Below A ˆR 0 {} 13 COMP4161 c Data61, CSIRO: provided under Creative Commons Attribution License

45 Generation from Below A ˆR 0 {} ˆR 1 {} 13 COMP4161 c Data61, CSIRO: provided under Creative Commons Attribution License

46 Generation from Below A ˆR ˆR 0 {} ˆR 1 {} ˆR 2 {} 13 COMP4161 c Data61, CSIRO: provided under Creative Commons Attribution License

47 Generation from Below A ˆR ˆR 0 {} ˆR ˆR 1 {} ˆR 2 {} COMP4161 c Data61, CSIRO: provided under Creative Commons Attribution License

48 Does this always work? Knaster-Tarski Fixpoint Theorem: Let (A, ) be a complete lattice, and f :: A A a monotone function. Then the fixpoints of f again form a complete lattice. 14 COMP4161 c Data61, CSIRO: provided under Creative Commons Attribution License

49 Does this always work? Knaster-Tarski Fixpoint Theorem: Let (A, ) be a complete lattice, and f :: A A a monotone function. Then the fixpoints of f again form a complete lattice. Lattice: Finite subsets have a greatest lower bound (meet) and least upper bound (join). 14 COMP4161 c Data61, CSIRO: provided under Creative Commons Attribution License

50 Does this always work? Knaster-Tarski Fixpoint Theorem: Let (A, ) be a complete lattice, and f :: A A a monotone function. Then the fixpoints of f again form a complete lattice. Lattice: Finite subsets have a greatest lower bound (meet) and least upper bound (join). Complete Lattice: All subsets have a greatest lower bound and least upper bound. 14 COMP4161 c Data61, CSIRO: provided under Creative Commons Attribution License

51 Does this always work? Knaster-Tarski Fixpoint Theorem: Let (A, ) be a complete lattice, and f :: A A a monotone function. Then the fixpoints of f again form a complete lattice. Lattice: Finite subsets have a greatest lower bound (meet) and least upper bound (join). Complete Lattice: All subsets have a greatest lower bound and least upper bound. Implications: least and greatest fixpoints exist (complete lattice always non-empty). 14 COMP4161 c Data61, CSIRO: provided under Creative Commons Attribution License

52 Does this always work? Knaster-Tarski Fixpoint Theorem: Let (A, ) be a complete lattice, and f :: A A a monotone function. Then the fixpoints of f again form a complete lattice. Lattice: Finite subsets have a greatest lower bound (meet) and least upper bound (join). Complete Lattice: All subsets have a greatest lower bound and least upper bound. Implications: least and greatest fixpoints exist (complete lattice always non-empty). can be reached by (possibly infinite) iteration. (Why?) 14 COMP4161 c Data61, CSIRO: provided under Creative Commons Attribution License

53 Exercise Formalize the this lecture in Isabelle: Define closed f A :: (α set α set) α set bool Show closed f A closed f B = closed f (A B) if f is monotone (mono is predefined) Define lfpt f as the intersection of all f -closed sets Show that lfpt f is a fixpoint of f if f is monotone Show that lfpt f is the least fixpoint of f Declare a constant R :: (α set α) set Define ˆR :: α set α set in terms of R Show soundness of rule induction using R and lfpt ˆR 15 COMP4161 c Data61, CSIRO: provided under Creative Commons Attribution License

54 We have learned today... Formal background of inductive definitions 16 COMP4161 c Data61, CSIRO: provided under Creative Commons Attribution License

55 We have learned today... Formal background of inductive definitions Definition by intersection 16 COMP4161 c Data61, CSIRO: provided under Creative Commons Attribution License

56 We have learned today... Formal background of inductive definitions Definition by intersection Computation by iteration 16 COMP4161 c Data61, CSIRO: provided under Creative Commons Attribution License

57 We have learned today... Formal background of inductive definitions Definition by intersection Computation by iteration Formalisation in Isabelle 16 COMP4161 c Data61, CSIRO: provided under Creative Commons Attribution License

λ Slide 1 Content Exercises from last time λ-calculus COMP 4161 NICTA Advanced Course Advanced Topics in Software Verification

λ Slide 1 Content Exercises from last time λ-calculus COMP 4161 NICTA Advanced Course Advanced Topics in Software Verification Content COMP 4161 NICTA Advanced Course Advanced Topics in Software Verification Toby Murray, June Andronick, Gerwin Klein λ Slide 1 Intro & motivation, getting started [1] Foundations & Principles Lambda

More information

Inductive Definitions and Fixed Points

Inductive Definitions and Fixed Points 6. Inductive Definitions and Fixed Points 6.0 6. Inductive Definitions and Fixed Points 6.0 Chapter 6 Overview of Chapter Inductive Definitions and Fixed Points 6. Inductive Definitions and Fixed Points

More information

NICTA Advanced Course. Theorem Proving Principles, Techniques, Applications. Gerwin Klein Formal Methods

NICTA Advanced Course. Theorem Proving Principles, Techniques, Applications. Gerwin Klein Formal Methods NICTA Advanced Course Theorem Proving Principles, Techniques, Applications Gerwin Klein Formal Methods 1 ORGANISATORIALS When Mon 14:00 15:30 Wed 10:30 12:00 7 weeks ends Mon, 20.9.2004 Exceptions Mon

More information

FORMAL METHODS LECTURE V: CTL MODEL CHECKING

FORMAL METHODS LECTURE V: CTL MODEL CHECKING FORMAL METHODS LECTURE V: CTL MODEL CHECKING Alessandro Artale Faculty of Computer Science Free University of Bolzano Room 2.03 artale@inf.unibz.it http://www.inf.unibz.it/ artale/ Some material (text,

More information

A should be R-closed: R(A) A. We would like this to hold because we would like every element that the rules say should be in A to actually be in A.

A should be R-closed: R(A) A. We would like this to hold because we would like every element that the rules say should be in A to actually be in A. CS 6110 S18 Lecture 7 Inductive Definitions and Least Fixed Points 1 Set Operators Last time we considered a set of rule instances of the form X 1 X 2... X n, (1) X where X and the X i are members of some

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

Propositional Logic Language

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

More information

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

Lattices and Orders in Isabelle/HOL

Lattices and Orders in Isabelle/HOL Lattices and Orders in Isabelle/HOL Markus Wenzel TU München October 8, 2017 Abstract We consider abstract structures of orders and lattices. Many fundamental concepts of lattice theory are developed,

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

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

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

More information

Semantics and Verification of Software

Semantics and Verification of Software Semantics and Verification of Software Thomas Noll Software Modeling and Verification Group RWTH Aachen University http://moves.rwth-aachen.de/teaching/ws-1718/sv-sw/ Recap: The Denotational Approach Semantics

More information

The Knaster-Tarski Fixed Point Theorem for Complete Partial Orders

The Knaster-Tarski Fixed Point Theorem for Complete Partial Orders The Knaster-Tarski Fixed Point Theorem for Complete Partial Orders Stephen Forrest October 31, 2005 Complete Lattices Let (X, ) be a be partially ordered set, and let S X. Then S ( the meet of S ) denotes

More information

Model Checking Algorithms

Model Checking Algorithms Model Checking Algorithms Bow-Yaw Wang Institute of Information Science Academia Sinica, Taiwan November 14, 2018 Bow-Yaw Wang (Academia Sinica) Model Checking Algorithms November 14, 2018 1 / 56 Outline

More information

On the coinductive nature of centralizers

On the coinductive nature of centralizers On the coinductive nature of centralizers Charles Grellois INRIA & University of Bologna Séminaire du LIFO Jan 16, 2017 Charles Grellois (INRIA & Bologna) On the coinductive nature of centralizers Jan

More information

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

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

More information

A Fixed Point Representation of References

A Fixed Point Representation of References A Fixed Point Representation of References Susumu Yamasaki Department of Computer Science, Okayama University, Okayama, Japan yamasaki@momo.cs.okayama-u.ac.jp Abstract. This position paper is concerned

More information

Recursion and Intro to Coq

Recursion and Intro to Coq L02-1 Recursion and Intro to Coq Armando Solar Lezama Computer Science and Artificial Intelligence Laboratory M.I.T. With content from Arvind and Adam Chlipala. Used with permission. September 21, 2015

More information

Automated Reasoning Lecture 5: First-Order Logic

Automated Reasoning Lecture 5: First-Order Logic Automated Reasoning Lecture 5: First-Order Logic Jacques Fleuriot jdf@inf.ac.uk Recap Over the last three lectures, we have looked at: Propositional logic, semantics and proof systems Doing propositional

More information

Introduction to Axiomatic Semantics

Introduction to Axiomatic Semantics Introduction to Axiomatic Semantics Meeting 9, CSCI 5535, Spring 2009 Announcements Homework 3 is out, due Mon Feb 16 No domain theory! Homework 1 is graded Feedback attached 14.2 (mean), 13 (median),

More information

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

Reading: Chapter 9.3. Carnegie Mellon

Reading: Chapter 9.3. Carnegie Mellon I II Lecture 3 Foundation of Data Flow Analysis Semi-lattice (set of values, meet operator) Transfer functions III Correctness, precision and convergence IV Meaning of Data Flow Solution Reading: Chapter

More information

Automated Reasoning Lecture 17: Inductive Proof (in Isabelle)

Automated Reasoning Lecture 17: Inductive Proof (in Isabelle) Automated Reasoning Lecture 17: Inductive Proof (in Isabelle) Jacques Fleuriot jdf@inf.ed.ac.uk Recap Previously: Unification and Rewriting This time: Proof by Induction (in Isabelle) Proof by Mathematical

More information

The Reflection Theorem

The Reflection Theorem The Reflection Theorem Formalizing Meta-Theoretic Reasoning Lawrence C. Paulson Computer Laboratory Lecture Overview Motivation for the Reflection Theorem Proving the Theorem in Isabelle Applying the Reflection

More information

CS411 Notes 3 Induction and Recursion

CS411 Notes 3 Induction and Recursion CS411 Notes 3 Induction and Recursion A. Demers 5 Feb 2001 These notes present inductive techniques for defining sets and subsets, for defining functions over sets, and for proving that a property holds

More information

The Small Progress Measures algorithm for Parity games

The Small Progress Measures algorithm for Parity games The Small Progress Measures algorithm for Parity games Material: Small Progress Measures for Solving Parity Games, Marcin Jurdziński Jeroen J.A. Keiren jkeiren@win.tue.nl http://www.win.tue.nl/ jkeiren

More information

Contents Propositional Logic: Proofs from Axioms and Inference Rules

Contents Propositional Logic: Proofs from Axioms and Inference Rules Contents 1 Propositional Logic: Proofs from Axioms and Inference Rules... 1 1.1 Introduction... 1 1.1.1 An Example Demonstrating the Use of Logic in Real Life... 2 1.2 The Pure Propositional Calculus...

More information

WUCT121. Discrete Mathematics. Numbers

WUCT121. Discrete Mathematics. Numbers WUCT121 Discrete Mathematics Numbers 1. Natural Numbers 2. Integers and Real Numbers 3. The Principle of Mathematical Induction 4. Elementary Number Theory 5. Congruence Arithmetic WUCT121 Numbers 1 Section

More information

HOL: Well-founded and Primitive Recursion

HOL: Well-founded and Primitive Recursion Dipl.-Inf. Achim D. Brucker Dr. Burkhart Wolff Computer-supported Modeling and Reasoning http://www.infsec.ethz.ch/ education/permanent/csmr/ (rev. 16814) Submission date: HOL: Well-founded and Primitive

More information

ClC (X ) : X ω X } C. (11)

ClC (X ) : X ω X } C. (11) With each closed-set system we associate a closure operation. Definition 1.20. Let A, C be a closed-set system. Define Cl C : : P(A) P(A) as follows. For every X A, Cl C (X) = { C C : X C }. Cl C (X) is

More information

Interprocedural Analysis: Sharir-Pnueli s Call-strings Approach

Interprocedural Analysis: Sharir-Pnueli s Call-strings Approach Interprocedural Analysis: Sharir-Pnueli s Call-strings Approach Deepak D Souza Department of Computer Science and Automation Indian Institute of Science, Bangalore. 04 September 2013 Outline 1 Motivation

More information

Discrete Mathematics. (c) Marcin Sydow. Sets. Set operations. Sets. Set identities Number sets. Pair. Power Set. Venn diagrams

Discrete Mathematics. (c) Marcin Sydow. Sets. Set operations. Sets. Set identities Number sets. Pair. Power Set. Venn diagrams Contents : basic definitions and notation A set is an unordered collection of its elements (or members). The set is fully specified by its elements. Usually capital letters are used to name sets and lowercase

More information

Sets, Proofs and Functions. Anton Velinov

Sets, Proofs and Functions. Anton Velinov Sets, Proofs and Functions Anton Velinov DIW WS 2018 Takeaways Sets and set operations. De Morgan s laws. Logical quantifiers and operators. Implication. Methods of proof, deduction, induction, contradiction.

More information

Formal Methods in Software Engineering

Formal Methods in Software Engineering Formal Methods in Software Engineering An Introduction to Model-Based Analyis and Testing Vesal Vojdani Department of Computer Science University of Tartu Fall 2014 Vesal Vojdani (University of Tartu)

More information

Static Program Analysis using Abstract Interpretation

Static Program Analysis using Abstract Interpretation Static Program Analysis using Abstract Interpretation Introduction Static Program Analysis Static program analysis consists of automatically discovering properties of a program that hold for all possible

More information

Semantics of intuitionistic propositional logic

Semantics of intuitionistic propositional logic Semantics of intuitionistic propositional logic Erik Palmgren Department of Mathematics, Uppsala University Lecture Notes for Applied Logic, Fall 2009 1 Introduction Intuitionistic logic is a weakening

More information

06 Recursive Definition and Inductive Proof

06 Recursive Definition and Inductive Proof CAS 701 Fall 2002 06 Recursive Definition and Inductive Proof Instructor: W. M. Farmer Revised: 30 November 2002 1 What is Recursion? Recursion is a method of defining a structure or operation in terms

More information

185.A09 Advanced Mathematical Logic

185.A09 Advanced Mathematical Logic 185.A09 Advanced Mathematical Logic www.volny.cz/behounek/logic/teaching/mathlog13 Libor Běhounek, behounek@cs.cas.cz Lecture #1, October 15, 2013 Organizational matters Study materials will be posted

More information

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

THE AUSTRALIAN NATIONAL UNIVERSITY Second Semester COMP2600 (Formal Methods for Software Engineering) THE AUSTRALIAN NATIONAL UNIVERSITY Second Semester 2012 COMP2600 (Formal Methods for Software Engineering) Writing Period: 3 hours duration Study Period: 15 minutes duration Permitted Materials: One A4

More information

A Monad For Randomized Algorithms

A Monad For Randomized Algorithms A Monad For Randomized Algorithms Tyler Barker Tulane University 1 Domains XII August 26, 2015 1 Supported by AFOSR Tyler Barker Tulane University A Monad For Randomized Algorithms Domains XII August 26,

More information

A Certified Denotational Abstract Interpreter (Proof Pearl)

A Certified Denotational Abstract Interpreter (Proof Pearl) A Certified Denotational Abstract Interpreter (Proof Pearl) David Pichardie INRIA Rennes David Cachera IRISA / ENS Cachan (Bretagne) Static Analysis Static Analysis Static analysis by abstract interpretation

More information

Lecture 1: Lattice(I)

Lecture 1: Lattice(I) Discrete Mathematics (II) Spring 207 Lecture : Lattice(I) Lecturer: Yi Li Lattice is a special algebra structure. It is also a part of theoretic foundation of model theory, which formalizes the semantics

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

Beyond First-Order Logic

Beyond First-Order Logic Beyond First-Order Logic Software Formal Verification Maria João Frade Departmento de Informática Universidade do Minho 2008/2009 Maria João Frade (DI-UM) Beyond First-Order Logic MFES 2008/09 1 / 37 FOL

More information

Introduction to Turing Machines

Introduction to Turing Machines Introduction to Turing Machines Deepak D Souza Department of Computer Science and Automation Indian Institute of Science, Bangalore. 12 November 2015 Outline 1 Turing Machines 2 Formal definitions 3 Computability

More information

AI Principles, Semester 2, Week 2, Lecture 5 Propositional Logic and Predicate Logic

AI Principles, Semester 2, Week 2, Lecture 5 Propositional Logic and Predicate Logic AI Principles, Semester 2, Week 2, Lecture 5 Propositional Logic and Predicate Logic Propositional logic Logical connectives Rules for wffs Truth tables for the connectives Using Truth Tables to evaluate

More information

Warm-Up Problem. Is the following true or false? 1/35

Warm-Up Problem. Is the following true or false? 1/35 Warm-Up Problem Is the following true or false? 1/35 Propositional Logic: Resolution Carmen Bruni Lecture 6 Based on work by J Buss, A Gao, L Kari, A Lubiw, B Bonakdarpour, D Maftuleac, C Roberts, R Trefler,

More information

Logic, Sets, and Proofs

Logic, Sets, and Proofs Logic, Sets, and Proofs David A. Cox and Catherine C. McGeoch Amherst College 1 Logic Logical Operators. A logical statement is a mathematical statement that can be assigned a value either true or false.

More information

Towards a Mechanised Denotational Semantics for Modelica

Towards a Mechanised Denotational Semantics for Modelica Towards a Mechanised Denotational Semantics for Modelica Simon Foster Bernhard Thiele Jim Woodcock Peter Fritzson Department of Computer Science, University of York PELAB, Linköping University 3rd February

More information

Operational Semantics

Operational Semantics Operational Semantics Semantics and applications to verification Xavier Rival École Normale Supérieure Xavier Rival Operational Semantics 1 / 50 Program of this first lecture Operational semantics Mathematical

More information

Introduction to Abstract Interpretation. ECE 584 Sayan Mitra Lecture 18

Introduction to Abstract Interpretation. ECE 584 Sayan Mitra Lecture 18 Introduction to Abstract Interpretation ECE 584 Sayan Mitra Lecture 18 References Patrick Cousot,RadhiaCousot:Abstract Interpretation: A Unified Lattice Model for Static Analysis of Programs by Construction

More information

Lecture Notes 1 Basic Concepts of Mathematics MATH 352

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

More information

SEMANTICS OF INTUITIONISTIC PROPOSITIONAL LOGIC: HEYTING ALGEBRAS AND KRIPKE MODELS

SEMANTICS OF INTUITIONISTIC PROPOSITIONAL LOGIC: HEYTING ALGEBRAS AND KRIPKE MODELS SEMNTICS OF INTUITIONISTIC PROPOSITIONL LOGIC: HEYTING LGEBRS ND KRIPKE MODELS CHD E. BROWN bstract. We describe two well-known semantics for intuitionistic propositional logic: Heyting algebras and Kripke

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

4 Limit and Continuity of Functions

4 Limit and Continuity of Functions Module 2 : Limits and Continuity of Functions Lecture 4 : Limit at a point Objectives In this section you will learn the following The sequential concept of limit of a function The definition of the limit

More information

MATH3283W LECTURE NOTES: WEEK 6 = 5 13, = 2 5, 1 13

MATH3283W LECTURE NOTES: WEEK 6 = 5 13, = 2 5, 1 13 MATH383W LECTURE NOTES: WEEK 6 //00 Recursive sequences (cont.) Examples: () a =, a n+ = 3 a n. The first few terms are,,, 5 = 5, 3 5 = 5 3, Since 5

More information

COMP 2600: Formal Methods for Software Engineeing

COMP 2600: Formal Methods for Software Engineeing COMP 2600: Formal Methods for Software Engineeing Dirk Pattinson Semester 2, 2013 What do we mean by FORMAL? Oxford Dictionary in accordance with convention or etiquette or denoting a style of writing

More information

Propositional Logic Arguments (5A) Young W. Lim 10/11/16

Propositional Logic Arguments (5A) Young W. Lim 10/11/16 Propositional Logic (5A) Young W. Lim Copyright (c) 2016 Young W. Lim. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version

More information

COMP9020 Lecture 3 Session 2, 2014 Sets, Functions, and Sequences. Revision: 1.3

COMP9020 Lecture 3 Session 2, 2014 Sets, Functions, and Sequences. Revision: 1.3 1 COMP9020 Lecture 3 Session 2, 2014 Sets, Functions, and Sequences Revision: 1.3 2 Notation for Numbers Definition Integers Z = {... 2, 1, 0, 1, 2,...} Reals R. : R Z floor of x, the greatest integer

More information

Logical specification and coinduction

Logical specification and coinduction Logical specification and coinduction Robert J. Simmons Carnegie Mellon University, Pittsburgh PA 15213, USA, rjsimmon@cs.cmu.edu, WWW home page: http://www.cs.cmu.edu/ rjsimmon Abstract. The notion of

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

Convexity in R N Supplemental Notes 1

Convexity in R N Supplemental Notes 1 John Nachbar Washington University November 1, 2014 Convexity in R N Supplemental Notes 1 1 Introduction. These notes provide exact characterizations of support and separation in R N. The statement of

More information

Teaching vs. Learning, and Course Wrap-Up

Teaching vs. Learning, and Course Wrap-Up Teaching vs. Learning, and Course Wrap-Up Sanjit A. Seshia EECS 219C EECS Department UC Berkeley Teaching vs. Learning Learning: Examples Concept Teaching: Concept Examples Given a concept, give a good

More information

Computational Logic Fundamentals (of Definite Programs): Syntax and Semantics

Computational Logic Fundamentals (of Definite Programs): Syntax and Semantics Computational Logic Fundamentals (of Definite Programs): Syntax and Semantics 1 Towards Logic Programming Conclusion: resolution is a complete and effective deduction mechanism using: Horn clauses (related

More information

Universal Algebra for Logics

Universal Algebra for Logics Universal Algebra for Logics Joanna GRYGIEL University of Czestochowa Poland j.grygiel@ajd.czest.pl 2005 These notes form Lecture Notes of a short course which I will give at 1st School on Universal Logic

More information

2 Lecture 2: Logical statements and proof by contradiction Lecture 10: More on Permutations, Group Homomorphisms 31

2 Lecture 2: Logical statements and proof by contradiction Lecture 10: More on Permutations, Group Homomorphisms 31 Contents 1 Lecture 1: Introduction 2 2 Lecture 2: Logical statements and proof by contradiction 7 3 Lecture 3: Induction and Well-Ordering Principle 11 4 Lecture 4: Definition of a Group and examples 15

More information

Homework #2 Solutions Due: September 5, for all n N n 3 = n2 (n + 1) 2 4

Homework #2 Solutions Due: September 5, for all n N n 3 = n2 (n + 1) 2 4 Do the following exercises from the text: Chapter (Section 3):, 1, 17(a)-(b), 3 Prove that 1 3 + 3 + + n 3 n (n + 1) for all n N Proof The proof is by induction on n For n N, let S(n) be the statement

More information

2. Introduction to commutative rings (continued)

2. Introduction to commutative rings (continued) 2. Introduction to commutative rings (continued) 2.1. New examples of commutative rings. Recall that in the first lecture we defined the notions of commutative rings and field and gave some examples of

More information

Introduction to Proofs

Introduction to Proofs Real Analysis Preview May 2014 Properties of R n Recall Oftentimes in multivariable calculus, we looked at properties of vectors in R n. If we were given vectors x =< x 1, x 2,, x n > and y =< y1, y 2,,

More information

Lecture 11: Measuring the Complexity of Proofs

Lecture 11: Measuring the Complexity of Proofs IAS/PCMI Summer Session 2000 Clay Mathematics Undergraduate Program Advanced Course on Computational Complexity Lecture 11: Measuring the Complexity of Proofs David Mix Barrington and Alexis Maciel July

More information

ISTITUTO DI ANALISI DEI SISTEMI ED INFORMATICA

ISTITUTO DI ANALISI DEI SISTEMI ED INFORMATICA ISTITUTO DI ANALISI DEI SISTEMI ED INFORMATICA CONSIGLIO NAZIONALE DELLE RICERCHE A. Pettorossi, M. Proietti TOTALLY CORRECT LOGIC PROGRAM TRANSFORMATIONS VIA WELL-FOUNDED ANNOTATIONS R. 639 Febbraio 2006

More information

COMP Logic for Computer Scientists. Lecture 16

COMP Logic for Computer Scientists. Lecture 16 COMP 1002 Logic for Computer Scientists Lecture 16 5 2 J Proof by contradiction To prove x F(x), prove x F x FLSE niversal instantiation: let n be an arbitrary element of the domain S of x Suppose that

More information

Goal. Partially-ordered set. Game plan 2/2/2013. Solving fixpoint equations

Goal. Partially-ordered set. Game plan 2/2/2013. Solving fixpoint equations Goal Solving fixpoint equations Many problems in programming languages can be formulated as the solution of a set of mutually recursive equations: D: set, f,g:dxd D x = f(x,y) y = g(x,y) Examples Parsing:

More information

Simply Typed λ-calculus

Simply Typed λ-calculus Simply Typed λ-calculus Lecture 1 Jeremy Dawson The Australian National University Semester 2, 2017 Jeremy Dawson (ANU) COMP4630,Lecture 1 Semester 2, 2017 1 / 23 A Brief History of Type Theory First developed

More information

Proseminar on Semantic Theory Fall 2013 Ling 720 Propositional Logic: Syntax and Natural Deduction 1

Proseminar on Semantic Theory Fall 2013 Ling 720 Propositional Logic: Syntax and Natural Deduction 1 Propositional Logic: Syntax and Natural Deduction 1 The Plot That Will Unfold I want to provide some key historical and intellectual context to the model theoretic approach to natural language semantics,

More information

Math From Scratch Lesson 29: Decimal Representation

Math From Scratch Lesson 29: Decimal Representation Math From Scratch Lesson 29: Decimal Representation W. Blaine Dowler January, 203 Contents Introducing Decimals 2 Finite Decimals 3 2. 0................................... 3 2.2 2....................................

More information

Course Runtime Verification

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

More information

Linear Algebra. Preliminary Lecture Notes

Linear Algebra. Preliminary Lecture Notes Linear Algebra Preliminary Lecture Notes Adolfo J. Rumbos c Draft date May 9, 29 2 Contents 1 Motivation for the course 5 2 Euclidean n dimensional Space 7 2.1 Definition of n Dimensional Euclidean Space...........

More information

Part II Logic and Set Theory

Part II Logic and Set Theory Part II Logic and Set Theory Theorems Based on lectures by I. B. Leader Notes taken by Dexter Chua Lent 2015 These notes are not endorsed by the lecturers, and I have modified them (often significantly)

More information

Partial model checking via abstract interpretation

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

More information

Finite Automata Theory and Formal Languages TMV027/DIT321 LP Recap: Logic, Sets, Relations, Functions

Finite Automata Theory and Formal Languages TMV027/DIT321 LP Recap: Logic, Sets, Relations, Functions Finite Automata Theory and Formal Languages TMV027/DIT321 LP4 2017 Formal proofs; Simple/strong induction; Mutual induction; Inductively defined sets; Recursively defined functions. Lecture 3 Ana Bove

More information

Comp487/587 - Boolean Formulas

Comp487/587 - Boolean Formulas Comp487/587 - Boolean Formulas 1 Logic and SAT 1.1 What is a Boolean Formula Logic is a way through which we can analyze and reason about simple or complicated events. In particular, we are interested

More information

6.254 : Game Theory with Engineering Applications Lecture 8: Supermodular and Potential Games

6.254 : Game Theory with Engineering Applications Lecture 8: Supermodular and Potential Games 6.254 : Game Theory with Engineering Applications Lecture 8: Supermodular and Asu Ozdaglar MIT March 2, 2010 1 Introduction Outline Review of Supermodular Games Reading: Fudenberg and Tirole, Section 12.3.

More information

Ultimate approximation and its application in nonmonotonic knowledge representation systems

Ultimate approximation and its application in nonmonotonic knowledge representation systems Ultimate approximation and its application in nonmonotonic knowledge representation systems Marc Denecker Department of Computer Science, K.U.Leuven Celestijnenlaan 200A, B-3001 Heverlee Département d

More information

Code Generation for a Simple First-Order Prover

Code Generation for a Simple First-Order Prover Code Generation for a Simple First-Order Prover Jørgen Villadsen, Anders Schlichtkrull, and Andreas Halkjær From DTU Compute, Technical University of Denmark, 2800 Kongens Lyngby, Denmark Abstract. We

More information

PREDICATE LOGIC: UNDECIDABILITY AND INCOMPLETENESS HUTH AND RYAN 2.5, SUPPLEMENTARY NOTES 2

PREDICATE LOGIC: UNDECIDABILITY AND INCOMPLETENESS HUTH AND RYAN 2.5, SUPPLEMENTARY NOTES 2 PREDICATE LOGIC: UNDECIDABILITY AND INCOMPLETENESS HUTH AND RYAN 2.5, SUPPLEMENTARY NOTES 2 Neil D. Jones DIKU 2005 14 September, 2005 Some slides today new, some based on logic 2004 (Nils Andersen) OUTLINE,

More information

cis32-ai lecture # 18 mon-3-apr-2006

cis32-ai lecture # 18 mon-3-apr-2006 cis32-ai lecture # 18 mon-3-apr-2006 today s topics: propositional logic cis32-spring2006-sklar-lec18 1 Introduction Weak (search-based) problem-solving does not scale to real problems. To succeed, problem

More information

Statistics for Financial Engineering Session 2: Basic Set Theory March 19 th, 2006

Statistics for Financial Engineering Session 2: Basic Set Theory March 19 th, 2006 Statistics for Financial Engineering Session 2: Basic Set Theory March 19 th, 2006 Topics What is a set? Notations for sets Empty set Inclusion/containment and subsets Sample spaces and events Operations

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

Metatheory of Recursive Types

Metatheory of Recursive Types Design Principles of Programming Languages Metatheory of Recursive Types Zhenjiang Hu, Haiyan Zhao, Yingfei Xiong Peking University, Spring Term, 2016 提醒 : 课程项目 6 月 8 日课程项目报告 每组报告 20 分钟, 提问 5 分钟 组队的同学请介绍每名成员的贡献

More information

Inductive Theorem Proving

Inductive Theorem Proving Introduction Inductive Proofs Automation Conclusion Automated Reasoning P.Papapanagiotou@sms.ed.ac.uk 11 October 2012 Introduction Inductive Proofs Automation Conclusion General Induction Theorem Proving

More information

An Abstract Interpretation Framework for Semantics and Diagnosis of Lazy Functional-Logic Languages

An Abstract Interpretation Framework for Semantics and Diagnosis of Lazy Functional-Logic Languages Università degli Studi di Udine Dipartimento di Matematica e Informatica Dottorato di Ricerca in Informatica Ph.D. Thesis An Abstract Interpretation Framework for Semantics and Diagnosis of Lazy Functional-Logic

More information

MA103 Introduction to Abstract Mathematics Second part, Analysis and Algebra

MA103 Introduction to Abstract Mathematics Second part, Analysis and Algebra 206/7 MA03 Introduction to Abstract Mathematics Second part, Analysis and Algebra Amol Sasane Revised by Jozef Skokan, Konrad Swanepoel, and Graham Brightwell Copyright c London School of Economics 206

More information

Marie Duží

Marie Duží Marie Duží marie.duzi@vsb.cz 1 Formal systems, Proof calculi A proof calculus (of a theory) is given by: 1. a language 2. a set of axioms 3. a set of deduction rules ad 1. The definition of a language

More information

BASIC CONCEPTS OF ABSTRACT INTERPRETATION

BASIC CONCEPTS OF ABSTRACT INTERPRETATION BASIC CONCEPTS OF ABSTRACT INTERPRETATION Patrick Cousot École Normale Supérieure 45 rue d Ulm 75230 Paris cedex 05, France Patrick.Cousot@ens.fr Radhia Cousot CNRS & École Polytechnique 91128 Palaiseau

More information

Abstract Interpretation: Fixpoints, widening, and narrowing

Abstract Interpretation: Fixpoints, widening, and narrowing Abstract Interpretation: Fixpoints, widening, and narrowing CS252r Fall 2015 Slides from Principles of Program Analysis by Nielson, Nielson, and Hankin http://www2.imm.dtu.dk/~riis/ppa/ppasup2004.html

More information

Linear Algebra. Preliminary Lecture Notes

Linear Algebra. Preliminary Lecture Notes Linear Algebra Preliminary Lecture Notes Adolfo J. Rumbos c Draft date April 29, 23 2 Contents Motivation for the course 5 2 Euclidean n dimensional Space 7 2. Definition of n Dimensional Euclidean Space...........

More information

Abstracting real-valued parameters in parameterised boolean equation systems

Abstracting real-valued parameters in parameterised boolean equation systems Department of Mathematics and Computer Science Formal System Analysis Research Group Abstracting real-valued parameters in parameterised boolean equation systems Master Thesis M. Laveaux Supervisor: dr.

More information

Automated Proving in Geometry using Gröbner Bases in Isabelle/HOL

Automated Proving in Geometry using Gröbner Bases in Isabelle/HOL Automated Proving in Geometry using Gröbner Bases in Isabelle/HOL Danijela Petrović Faculty of Mathematics, University of Belgrade, Serbia Abstract. For several decades, algebraic method have been successfully

More information

Proof assistants as a tool for thought

Proof assistants as a tool for thought Proof assistants as a tool for thought Katherine Ye @hypotext Tools for thought workshop, March 16 circa 1700 Disputants unable to agree would not waste much time in futile argument... Leibniz (Harrison)

More information