First Order Predicate Logic

Size: px
Start display at page:

Download "First Order Predicate Logic"

Transcription

1 Wolfgang Schreiner and Wolfgang Windsteiger 1/25 First Order Predicate Logic Formal Definitions and Specifications Wolfgang Schreiner and Wolfgang Windsteiger Wolfgang.(Schreiner Research Institute for Symbolic Computation (RISC) Johannes Kepler University (JKU), Linz, Austria

2 Wolfgang Schreiner and Wolfgang Windsteiger 2/25 Defining and Specifying Specifying problems and domains is a core activity of computer science. Goal: the adequate specification of a certain problem or type. A computation to be performed. A domain of values to be represented. Specification is to be expressed using the notions of some model. Given: a model, i.e., a collection of notions (functions/predicates). For example, the model set with the usual set operations. The interpretation of these notions is universally understood. Issue: the given model is not up to the task. Its notions are on a too low level of abstraction. The specification would become too cumbersome to write and too difficult to understand. We need a model that is on an appropriate level of abstraction.

3 Wolfgang Schreiner and Wolfgang Windsteiger 3/25 Refinement and Abstraction How to overcome the gap between the given model and the intended one? Top-down ( ): refinement. Start with the intended model. Reduce its notions to lower-level notions. Iterate, until the lowest level of the given notions is reached. Bottom-up ( ): abstraction. Start with the given model. Iteratively combine the given notions to higher-level notions. Iterate, until the highest level of the intended notions is reached. Bottom-up and top-down ( ): Combination of refinement and abstraction steps. Iterate, until the refined notions meet the abstracted ones. With the help of newly defined notions, problems and types may be adequately specified.

4 Wolfgang Schreiner and Wolfgang Windsteiger 4/25 Illustration Databases File Systems Text Files XML Documents Character Strings Floating Point Numbers Refinement Arrays Lists Trees Integers Abstraction Natural Numbers Functions Relations Products Sums Sets

5 Wolfgang Schreiner and Wolfgang Windsteiger 5/25 Some Standard Models Products: T 1... T n Let x1 T 1,...,x n T n,t T 1... T n. Tuple construction: (x1,...,x n ) T 1... T n. Element selection: t.1 T1,...,t.n T n (or: t 1 T 1,...,t n T n ). Functions: T 1... T n T Let x1 T 1,...,x n T n,f T 1... T n T. Function definition: see later. Function application: f (x1,...,x n ) T. domain(f ) = T1... T n, range(f ) T. Relations/Predicates: P(T 1... T n ) P(T ) : the powerset (the set of all subsets) of T. Let x1 T 1,...,x n T n,p P(T 1... T n ) (p T 1... T n ). Predicate definition: see later. Predicate application: p(x1,...,x n ) denotes a truth value. domain(p) = T1... T n. Can be reduced to set-theoretic notions.

6 Wolfgang Schreiner and Wolfgang Windsteiger 6/25 Some Standard Models Infinite Sequences: T ω = N T Let s T ω,i N. Element access s(i) T (or: si T ). Sequences of Length n: T n = N n T Index domain: Nn = {i N i < n}. Let s T n,i N n. Element access: s(i) T (or: si T ). Finite Sequences: T = n N T n Let s T, i.e., s T n for some n N, let i N n. Sequence length: length(s) = n. Element access: s(i) T (or: si T ). Sequences (arrays, lists,... ) of arbitrary length can be modeled as functions over an index domain.

7 Wolfgang Schreiner and Wolfgang Windsteiger 7/25 Formal Definitions and Specifications Explicit Function Definitions. Explicit Predicate Definitions. Implicit Function Definitions. Proving with Definitions. Problem Specifications.

8 Explicit Function Definitions A new function my be introduced by describing its value. An explicit function definition consists of f : T 1... T n T f (x 1,...,x n ) := t a new n-ary function constant f, a type signature T1... T n T withs sets T 1,...,T n,t, a list of variables x1,...,x n (the parameters), and a term t (the body) whose free variables occur in x1,...,x n ; case n = 0: the definition of a value constant f : T,f := t. We have to show for the newly introduced function f and then know x 1 T 1,...,x n T n : t T x 1 T 1,...,x n T n : f (x 1,...,x n ) = t The body of an explicit function definition may only refer to previously defined functions (no recursion). Wolfgang Schreiner and Wolfgang Windsteiger 8/25

9 Wolfgang Schreiner and Wolfgang Windsteiger 9/25 Examples sqrtsum : N N R sqrtsum(x,y) := x + y sumsquared : N N N sumsquared(x,y) := let z = x + y in z 2 sqrtsumsquared : N N R sqrtsumsquared(x,y) := sqrtsum(x,y) 2 sqrtsumset : N P(R) sqrtsumset(n) := {sqrtsum(x,y) x,y N 1 x,y n}

10 Wolfgang Schreiner and Wolfgang Windsteiger 10/25 Explicit Predicate Definitions A new predicate my be introduced by describing its truth value. An explicit predicate definition consists of p T 1... T n p(x 1,...,x n ) : F a new n-ary predicate constant p, a type signature T1... T n with sets T 1,...,T n a list of variables x1,...,x n (the parameters), and a formula F (the body) whose free variables occur in x1,...,x n. case n = 0: definition of a truth value constant p : F. We then know for the newly introduced predicate p: x 1 T 1,...,x n T n : p(x 1,...,x n ) F The body of an explicit predicate definition may only refer to previously defined predicates (no recursion).

11 Wolfgang Schreiner and Wolfgang Windsteiger 11/25 Examples N N x y : z N : x z = y isprime N isprime(x) : x 2 y N : 1 < y y < x (y x) isprimefactor N N isprimefactor(p, n) : isprime(p) p n

12 Wolfgang Schreiner and Wolfgang Windsteiger 12/25 Definitions with Side Conditions A definition may occur in the context of a side condition. Let x 1 T 1,...,x n T n be such that c(x 1,...,x n ). We define f (x 1,...,x n ) := t p(x 1,...,x n ) : F We then know for the newly introduced function/predicate x 1 T 1,...,x n T n : c(x 1,...,x n ) f (x 1,...,x n ) = t x 1 T 1,...,x n T n : c(x 1,...,x n ) (p(x 1,...,x n ) F ) Applications of the function/predicate to arguments that violate the side condition are meaningless.

13 Implicit Function Definitions We may also introduce a new function by describing what condition its result must satisfy. An implicit function definition consists of f : T 1... T n T f (x 1,...,x n ) := such y : F a new n-ary function constant f, a type signature T1... T n T withs sets T 1,...,T n,t, a list of variables x1,...,x n (the parameters), a variable y (the result variable), a formula F (the result condition) whose free variables occur in x 1,...,x n,y. We then know for the newly introduced function f x 1 T 1,...,x n T n : ( y T : F ) ( y T : F y = f (x 1,...,x n )) If there is some value that satisfies the result condition, the function result is one such value (otherwise, it is undefined). Wolfgang Schreiner and Wolfgang Windsteiger 13/25

14 Wolfgang Schreiner and Wolfgang Windsteiger 14/25 Examples quotient : N N N // undefined for n=0, otherwise unique quotient(m,n) := such q : r N : m = n q + r r < n root : R R // defined for non-negative x, but not unique root(x) := such r : r 2 = x someprimefactor : N N // may be undefined; if defined, may not be unique someprimefactor(n) := such p : isprimefactor(p, n) maxprime : N N // may be undefined; if defined, it is unique maxprime(n) := such p : isprime(p) p n ( q N : isprime(q) q n q p) The result of an implicitly specified function is not necessarily uniquely defined (and may be also completely undefined).

15 Implicit Unique Function Definitions But sometimes the result is uniquely defined by an implicit definition. An implicit unique function definition f : T 1... T n T f (x 1,...,x n ) := the y : F consists of the same elements as an unique function definition. We have to prove that the function result is defined and unique x 1 T 1,...,x n T n : ( y T : F ) ( y 1 T,y 2 T : F [y 1 /y] F [y 2 /y] y 1 = y 2 ) from which we know for the newly introduced function f x 1 T 1,...,x n T n : ( y T : F y = f (x 1,...,x n )) ( y T : F y = f (x 1,...,x n )) The function result is the only value that satisfies the result condition. Wolfgang Schreiner and Wolfgang Windsteiger 15/25

16 Wolfgang Schreiner and Wolfgang Windsteiger 16/25 Examples quot : R 0 R >0 R 0 // defined and unique quot(a,b) := the q : a = b q posroot : R 0 R 0 // defined and unique posroot(x) := the r : r 2 = x r 0 minimum : P(N)\{/0} N // defined and unique minimum(s) := the m : m S m S : m m

17 Wolfgang Schreiner and Wolfgang Windsteiger 17/25 Predicates versus Functions A predicate gives also rise to functions. A predicate: isprimefactor N N isprimefactor(p, n) : isprime(p) p n An implicitly defined function: someprimefactor : N N someprimefactor(n) := such p : isprime(p) p n A function whose result is a set: allprimefactors : N P(N) allprimefactors(n) := {p N isprime(p) p n} The preferred style of definition is a matter of taste and purpose.

18 Informal Definitions Definition: A tomcat is a male cat. tomcat(x) : cat(x) male(x). Definition: Let x,y be positive integers. Then gcd(x,y) denotes the greatest positive integer that divides both x and y. gcd : Z >0 Z >0 Z >0 gcd(x,y) := the z : z x z y z Z >0 : z x z y z z Definition: A prime factorization of n > 1 is a product p e 1 1 pe l l = n with primes p 1 <... < p l and exponents e i > 0. isprimefactorization N (N N) isprimefactorization(n, p) : let l = length(p) in l 1 n = (p(i).1) (p(i).2) i=0 ( i N l : prime(p(i).1)) ( i N l 1 : p(i).1 < p(i + 1).1) It is important to recognize the formal content of informal definitions. Wolfgang Schreiner and Wolfgang Windsteiger 18/25

19 Wolfgang Schreiner and Wolfgang Windsteiger 19/25 Proving with Definitions Given definitions f : A B, f (x) :=... p A, p(x) : we wish to prove some goal G which involves f,p,... We extract the knowledge provided by the definitions: x A : f (x) =... (K 1 ) x A : p(x)... (K 2 )... We prove (K 1 ),(K 2 ),... G The proof is performed with the knowledge provided by the definitions.

20 Wolfgang Schreiner and Wolfgang Windsteiger 20/25 Example If a divides b then it also divides every multiple of b. Definition: a divides b : t N : b = t a Knowledge (K): a N,b N : a divides b t N : b = t a P- : ValidAssum: P- : P- : P- : G-Def: A-Def: A-, A- : A-=: P- : (K) a,b,s N : a divides b a divides s b (K) ā, b, s N (ā divides b ā divides s b) (K),ā, b, s N ā divides b ā divides s b (K),ā, b, s N,ā divides b ā divides s b (K),ā, b, s N,ā divides b t N : s b = t ā (K),ā, b, s N, t N : b = t ā t N : s b = t ā (K),ā, b, s, t N, b = t ā t N : s b = t ā (K),ā, b, s, t N, b = t ā t N : s t ā = t ā (K),ā, b, s, t N, b = t ā s t N s t ā = s t ā (K),..., s, t N s t N GoalAssum: P-=: (K),... s t ā = s t ā

21 Wolfgang Schreiner and Wolfgang Windsteiger 21/25 Example: Explanation Derivation of G-Def: A- : A- : AnyAssum: (K),ā, b, s N,ā divides b ā divides s b (K),ā, b, s N,ā divides b,ā divides s b t N : s b = t ā ā divides s b (K),ā, b, s N,ā divides b,ā divides s b t N : s b = t ā t N : s b = t ā (K),ā, b, s N,ā divides b t N : s b = t ā Analogous derivation of A-Def. Definitions can be expanded in goal and knowledge.

22 Wolfgang Schreiner and Wolfgang Windsteiger 22/25 Specifying Problems An important role of logic in computer science is to specify problems. The specification of a (computational) problem consists of Input: x 1 T 1,...,x n T n where I Output: y 1 U 1,...,y m U m where O a list of input variables x1,...,x n with types T 1,...,T n, a formula I (the input condition) whose free variables occur in x 1,...,x n, a list of output variables y1,...,y m with types U 1,...,U m, and a formula O (the output condition) whose free variables occur in x 1,...,x n,y 1,...,y m. The specification is expressed with the help of functions and predicates that have been previously defined to describe the problem domain.

23 Wolfgang Schreiner and Wolfgang Windsteiger 23/25 Example Extract from a finite sequence s of natural numbers a subsequence of length n starting at position p. p n s t Input: s N,n N,p N where n + p length(s) Output: t N where length(t) = n i N n : t(i) = s(i + p) The resulting sequence must have appropriate length and content.

24 Implementing Problem Specifications The ultimate goal of computer science is to implement specifications. The specifications demands the definition of a function f : T 1... T n U 1... U m such that x 1 T 1,...,x n T n : I let (y 1,...,y m ) = f (x 1,...,x n ) in O For all arguments x1,...,x n that satisfy the input condition, the result (y1,...,y m ) of f satisfies the output condition. The specification itself already implicitly defines such a function: f (x 1,...,x n ) := such y 1,...,y m : I O However, the specification is actually implemented only by an explicitly defined function (computer program). The correctness of the implementation with respect to the specification has to be verified (e.g. by a formal proof). Our goal is to adequately specify informal problems, to implement formal specifications, and to verify the correctness of the implementations. Wolfgang Schreiner and Wolfgang Windsteiger 24/25

25 Wolfgang Schreiner and Wolfgang Windsteiger 25/25 The Java Modeling Language (JML) A language for specifying the contracts of Java functions. /*@ requires s!= null && 0 <= p && 0 <= n && p+n <= ensures \result!= null && \result.length == n (\forall int i; 0 <= i && i < \result[i] == /*@ static int[] subarray(int[] s, int p, int n) { int[] t = new int[n]; for (int i=0; i<n; i++) t[i] = s[i+p]; return t; } The Java function implements the specified contract.

First Order Predicate Logic

First Order Predicate Logic Wolfgang Schreiner and Wolfgang Windsteiger http://www.risc.jku.at 1/22 First Order Predicate Logic Pragmatics Wolfgang Schreiner and Wolfgang Windsteiger Wolfgang.(Schreiner Windsteiger)@risc.jku.at Research

More information

First Order Predicate Logic

First Order Predicate Logic Wolfgang Schreiner and Wolfgang Windsteiger http://www.risc.jku.at 1/23 First Order Predicate Logic Syntax and Informal Semantics Wolfgang Schreiner and Wolfgang Windsteiger Wolfgang.(Schreiner Windsteiger)@risc.jku.at

More information

Turing Machines. Wolfgang Schreiner

Turing Machines. Wolfgang Schreiner Turing Machines Wolfgang Schreiner Wolfgang.Schreiner@risc.jku.at Research Institute for Symbolic Computation (RISC) Johannes Kepler University, Linz, Austria http://www.risc.jku.at Wolfgang Schreiner

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

Limits of Computability

Limits of Computability Limits of Computability Wolfgang Schreiner Wolfgang.Schreiner@risc.jku.at Research Institute for Symbolic Computation (RISC) Johannes Kepler University, Linz, Austria http://www.risc.jku.at Wolfgang Schreiner

More information

Turing machine. Turing Machine Model. Turing Machines. 1. Turing Machines. Wolfgang Schreiner 2. Recognizing Languages

Turing machine. Turing Machine Model. Turing Machines. 1. Turing Machines. Wolfgang Schreiner 2. Recognizing Languages Turing achines Wolfgang Schreiner Wolfgang.Schreiner@risc.jku.at Research Institute for Symbolic Computation (RISC) Johannes Kepler University, Linz, Austria http://www.risc.jku.at 1. Turing achines Wolfgang

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

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

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

Applying Predicate Logic to Monitoring Network Traffic

Applying Predicate Logic to Monitoring Network Traffic Applying Predicate Logic to Monitoring Network Traffic Wolfgang Schreiner Wolfgang.Schreiner@risc.jku.at Research Institute for Symbolic Computation (RISC) Johannes Kepler University, Linz, Austria http://www.risc.jku.at

More information

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

COMP9020 Lecture 3 Session 2, 2016 Sets, Functions, and Sequences. Revision: 1.3 1 COMP9020 Lecture 3 Session 2, 2016 Sets, Functions, and Sequences Revision: 1.3 2 Divisibility Let m, n Z. m n means m is a divisor of n, defined by n = km for some k Z (Also stated as: n is divisible

More information

Metainduction in Operational Set Theory

Metainduction in Operational Set Theory Metainduction in Operational Set Theory Luis E. Sanchis Department of Electrical Engineering and Computer Science Syracuse University Syracuse, NY 13244-4100 Sanchis@top.cis.syr.edu http://www.cis.syr.edu/

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

A JML Specification of the Design Pattern Visitor

A JML Specification of the Design Pattern Visitor A JML Specification of the Design Pattern Visitor Wolfgang Schreiner Research Institute for Symbolic Computation (RISC) Johannes Kepler University Linz, Austria Wolfgang.Schreiner@risc.jku.at September

More information

From Constructibility and Absoluteness to Computability and Domain Independence

From Constructibility and Absoluteness to Computability and Domain Independence From Constructibility and Absoluteness to Computability and Domain Independence Arnon Avron School of Computer Science Tel Aviv University, Tel Aviv 69978, Israel aa@math.tau.ac.il Abstract. Gödel s main

More information

Sets are one of the basic building blocks for the types of objects considered in discrete mathematics.

Sets are one of the basic building blocks for the types of objects considered in discrete mathematics. Section 2.1 Introduction Sets are one of the basic building blocks for the types of objects considered in discrete mathematics. Important for counting. Programming languages have set operations. Set theory

More information

Section 2.1: Introduction to the Logic of Quantified Statements

Section 2.1: Introduction to the Logic of Quantified Statements Section 2.1: Introduction to the Logic of Quantified Statements In the previous chapter, we studied a branch of logic called propositional logic or propositional calculus. Loosely speaking, propositional

More information

THE LOGIC OF QUANTIFIED STATEMENTS. Predicates and Quantified Statements I. Predicates and Quantified Statements I CHAPTER 3 SECTION 3.

THE LOGIC OF QUANTIFIED STATEMENTS. Predicates and Quantified Statements I. Predicates and Quantified Statements I CHAPTER 3 SECTION 3. CHAPTER 3 THE LOGIC OF QUANTIFIED STATEMENTS SECTION 3.1 Predicates and Quantified Statements I Copyright Cengage Learning. All rights reserved. Copyright Cengage Learning. All rights reserved. Predicates

More information

Limits of Feasibility. Example. Complexity Relationships among Models. 1. Complexity Relationships among Models

Limits of Feasibility. Example. Complexity Relationships among Models. 1. Complexity Relationships among Models Limits of Feasibility Wolfgang Schreiner Wolfgang.Schreiner@risc.jku.at Research Institute for Symbolic Computation (RISC) Johannes Kepler University, Linz, Austria http://www.risc.jku.at 1. Complexity

More information

Course 4 Finite Automata/Finite State Machines

Course 4 Finite Automata/Finite State Machines Course 4 Finite Automata/Finite State Machines The structure and the content of the lecture is based on (1) http://www.eecs.wsu.edu/~ananth/cpts317/lectures/index.htm, (2) W. Schreiner Computability and

More information

Recurrence Relations and Recursion: MATH 180

Recurrence Relations and Recursion: MATH 180 Recurrence Relations and Recursion: MATH 180 1: Recursively Defined Sequences Example 1: The sequence a 1,a 2,a 3,... can be defined recursively as follows: (1) For all integers k 2, a k = a k 1 + 1 (2)

More information

Mathematical Preliminaries. Sipser pages 1-28

Mathematical Preliminaries. Sipser pages 1-28 Mathematical Preliminaries Sipser pages 1-28 Mathematical Preliminaries This course is about the fundamental capabilities and limitations of computers. It has 3 parts 1. Automata Models of computation

More information

Notes on Satisfiability-Based Problem Solving. First Order Logic. David Mitchell October 23, 2013

Notes on Satisfiability-Based Problem Solving. First Order Logic. David Mitchell October 23, 2013 Notes on Satisfiability-Based Problem Solving First Order Logic David Mitchell mitchell@cs.sfu.ca October 23, 2013 Preliminary draft. Please do not distribute. Corrections and suggestions welcome. In this

More information

Foundations of Mathematics MATH 220 FALL 2017 Lecture Notes

Foundations of Mathematics MATH 220 FALL 2017 Lecture Notes Foundations of Mathematics MATH 220 FALL 2017 Lecture Notes These notes form a brief summary of what has been covered during the lectures. All the definitions must be memorized and understood. Statements

More information

First-Order Theorem Proving and Vampire

First-Order Theorem Proving and Vampire First-Order Theorem Proving and Vampire Laura Kovács 1,2 and Martin Suda 2 1 TU Wien 2 Chalmers Outline Introduction First-Order Logic and TPTP Inference Systems Saturation Algorithms Redundancy Elimination

More information

Path Testing and Test Coverage. Chapter 9

Path Testing and Test Coverage. Chapter 9 Path Testing and Test Coverage Chapter 9 Structural Testing Also known as glass/white/open box testing Structural testing is based on using specific knowledge of the program source text to define test

More information

Part I: Propositional Calculus

Part I: Propositional Calculus Logic Part I: Propositional Calculus Statements Undefined Terms True, T, #t, 1 False, F, #f, 0 Statement, Proposition Statement/Proposition -- Informal Definition Statement = anything that can meaningfully

More information

Path Testing and Test Coverage. Chapter 9

Path Testing and Test Coverage. Chapter 9 Path Testing and Test Coverage Chapter 9 Structural Testing Also known as glass/white/open box testing Structural testing is based on using specific knowledge of the program source text to define test

More information

Formal Language and Automata Theory (CS21004)

Formal Language and Automata Theory (CS21004) Theory (CS21004) Announcements The slide is just a short summary Follow the discussion and the boardwork Solve problems (apart from those we dish out in class) Table of Contents 1 2 3 Languages that are

More information

The constructible universe

The constructible universe The constructible universe In this set of notes I want to sketch Gödel s proof that CH is consistent with the other axioms of set theory. Gödel s argument goes well beyond this result; his identification

More information

Preliminaries. Introduction to EF-games. Inexpressivity results for first-order logic. Normal forms for first-order logic

Preliminaries. Introduction to EF-games. Inexpressivity results for first-order logic. Normal forms for first-order logic Introduction to EF-games Inexpressivity results for first-order logic Normal forms for first-order logic Algorithms and complexity for specific classes of structures General complexity bounds Preliminaries

More information

Set Theory. CSE 215, Foundations of Computer Science Stony Brook University

Set Theory. CSE 215, Foundations of Computer Science Stony Brook University Set Theory CSE 215, Foundations of Computer Science Stony Brook University http://www.cs.stonybrook.edu/~cse215 Set theory Abstract set theory is one of the foundations of mathematical thought Most mathematical

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

First-Order Theorem Proving and Vampire. Laura Kovács (Chalmers University of Technology) Andrei Voronkov (The University of Manchester)

First-Order Theorem Proving and Vampire. Laura Kovács (Chalmers University of Technology) Andrei Voronkov (The University of Manchester) First-Order Theorem Proving and Vampire Laura Kovács (Chalmers University of Technology) Andrei Voronkov (The University of Manchester) Outline Introduction First-Order Logic and TPTP Inference Systems

More information

Towards abstract and executable multivariate polynomials in Isabelle

Towards abstract and executable multivariate polynomials in Isabelle Towards abstract and executable multivariate polynomials in Isabelle Florian Haftmann Andreas Lochbihler Wolfgang Schreiner Institute for Informatics Institute of Information Security RISC TU Munich ETH

More information

Informal Statement Calculus

Informal Statement Calculus FOUNDATIONS OF MATHEMATICS Branches of Logic 1. Theory of Computations (i.e. Recursion Theory). 2. Proof Theory. 3. Model Theory. 4. Set Theory. Informal Statement Calculus STATEMENTS AND CONNECTIVES Example

More information

Axioms of Kleene Algebra

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

More information

Mathematical Induction. How does discrete math help us. How does discrete math help (CS160)? How does discrete math help (CS161)?

Mathematical Induction. How does discrete math help us. How does discrete math help (CS160)? How does discrete math help (CS161)? How does discrete math help us Helps create a solution (program) Helps analyze a program How does discrete math help (CS160)? Helps create a solution (program) q Logic helps you understand conditionals

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

Section Summary. Sequences. Recurrence Relations. Summations. Examples: Geometric Progression, Arithmetic Progression. Example: Fibonacci Sequence

Section Summary. Sequences. Recurrence Relations. Summations. Examples: Geometric Progression, Arithmetic Progression. Example: Fibonacci Sequence Section 2.4 1 Section Summary Sequences. Examples: Geometric Progression, Arithmetic Progression Recurrence Relations Example: Fibonacci Sequence Summations 2 Introduction Sequences are ordered lists of

More information

Chapter Summary. Mathematical Induction Strong Induction Well-Ordering Recursive Definitions Structural Induction Recursive Algorithms

Chapter Summary. Mathematical Induction Strong Induction Well-Ordering Recursive Definitions Structural Induction Recursive Algorithms 1 Chapter Summary Mathematical Induction Strong Induction Well-Ordering Recursive Definitions Structural Induction Recursive Algorithms 2 Section 5.1 3 Section Summary Mathematical Induction Examples of

More information

CSE507. Satisfiability Modulo Theories. Computer-Aided Reasoning for Software. Emina Torlak

CSE507. Satisfiability Modulo Theories. Computer-Aided Reasoning for Software. Emina Torlak Computer-Aided Reasoning for Software CSE507 Satisfiability Modulo Theories courses.cs.washington.edu/courses/cse507/18sp/ Emina Torlak emina@cs.washington.edu Today Last lecture Practical applications

More information

Towards Practical Reflection for Formal Mathematics

Towards Practical Reflection for Formal Mathematics Towards Practical Reflection for Formal Mathematics extended abstract Martin Giese and Bruno Buchberger RISC, Johannes Kepler University, A-4232 Schloß Hagenberg, Austria {bruno.buchberger martin.giese}@risc.uni-linz.ac.at

More information

Turing Machines (TM) Deterministic Turing Machine (DTM) Nondeterministic Turing Machine (NDTM)

Turing Machines (TM) Deterministic Turing Machine (DTM) Nondeterministic Turing Machine (NDTM) Turing Machines (TM) Deterministic Turing Machine (DTM) Nondeterministic Turing Machine (NDTM) 1 Deterministic Turing Machine (DTM).. B B 0 1 1 0 0 B B.. Finite Control Two-way, infinite tape, broken into

More information

Realizing the axiom of dependent choice

Realizing the axiom of dependent choice Realizing the axiom of dependent choice Jean-Louis Krivine PPS Group, University Paris 7, CNRS krivine@pps.jussieu.fr Edinburgh, March 26, 2003 1 The extended Curry-Howard correspondence We want to get

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

Any Wizard of Oz fans? Discrete Math Basics. Outline. Sets. Set Operations. Sets. Dorothy: How does one get to the Emerald City?

Any Wizard of Oz fans? Discrete Math Basics. Outline. Sets. Set Operations. Sets. Dorothy: How does one get to the Emerald City? Any Wizard of Oz fans? Discrete Math Basics Dorothy: How does one get to the Emerald City? Glynda: It is always best to start at the beginning Outline Sets Relations Proofs Sets A set is a collection of

More information

Induction and Recursion

Induction and Recursion . All rights reserved. Authorized only for instructor use in the classroom. No reproduction or further distribution permitted without the prior written consent of McGraw-Hill Education. Induction and Recursion

More information

an efficient procedure for the decision problem. We illustrate this phenomenon for the Satisfiability problem.

an efficient procedure for the decision problem. We illustrate this phenomenon for the Satisfiability problem. 1 More on NP In this set of lecture notes, we examine the class NP in more detail. We give a characterization of NP which justifies the guess and verify paradigm, and study the complexity of solving search

More information

15 Text search. P.D. Dr. Alexander Souza. Winter term 11/12

15 Text search. P.D. Dr. Alexander Souza. Winter term 11/12 Algorithms Theory 15 Text search P.D. Dr. Alexander Souza Text search Various scenarios: Dynamic texts Text editors Symbol manipulators Static texts Literature databases Library systems Gene databases

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

SEQUENCES, MATHEMATICAL INDUCTION, AND RECURSION

SEQUENCES, MATHEMATICAL INDUCTION, AND RECURSION CHAPTER 5 SEQUENCES, MATHEMATICAL INDUCTION, AND RECURSION Copyright Cengage Learning. All rights reserved. SECTION 5.4 Strong Mathematical Induction and the Well-Ordering Principle for the Integers Copyright

More information

Proofs. Methods of Proof Divisibility Floor and Ceiling Contradiction & Contrapositive Euclidean Algorithm. Reading (Epp s textbook)

Proofs. Methods of Proof Divisibility Floor and Ceiling Contradiction & Contrapositive Euclidean Algorithm. Reading (Epp s textbook) Proofs Methods of Proof Divisibility Floor and Ceiling Contradiction & Contrapositive Euclidean Algorithm Reading (Epp s textbook) 4.3 4.8 1 Divisibility The notation d n is read d divides n. Symbolically,

More information

Practice Test III, Math 314, Spring 2016

Practice Test III, Math 314, Spring 2016 Practice Test III, Math 314, Spring 2016 Dr. Holmes April 26, 2016 This is the 2014 test reorganized to be more readable. I like it as a review test. The students who took this test had to do four sections

More information

CSI Mathematical Induction. Many statements assert that a property of the form P(n) is true for all integers n.

CSI Mathematical Induction. Many statements assert that a property of the form P(n) is true for all integers n. CSI 2101- Mathematical Induction Many statements assert that a property of the form P(n) is true for all integers n. Examples: For every positive integer n: n! n n Every set with n elements, has 2 n Subsets.

More information

Lecture 4: Probability, Proof Techniques, Method of Induction Lecturer: Lale Özkahya

Lecture 4: Probability, Proof Techniques, Method of Induction Lecturer: Lale Özkahya BBM 205 Discrete Mathematics Hacettepe University http://web.cs.hacettepe.edu.tr/ bbm205 Lecture 4: Probability, Proof Techniques, Method of Induction Lecturer: Lale Özkahya Resources: Kenneth Rosen, Discrete

More information

Discrete Mathematics Review

Discrete Mathematics Review CS 1813 Discrete Mathematics Discrete Mathematics Review or Yes, the Final Will Be Comprehensive 1 Truth Tables for Logical Operators P Q P Q False False False P Q False P Q False P Q True P Q True P True

More information

A Guide to Proof-Writing

A Guide to Proof-Writing A Guide to Proof-Writing 437 A Guide to Proof-Writing by Ron Morash, University of Michigan Dearborn Toward the end of Section 1.5, the text states that there is no algorithm for proving theorems.... Such

More information

Using Continuous Real Functions to Model Timed Histories

Using Continuous Real Functions to Model Timed Histories Using Continuous Real Functions to Model Timed Histories Brendan Mahony Ian Hayes Department of Computer Science University of Queensland 4072 Australia July, 1991 Abstract Continuous real functions are

More information

Induction and recursion. Chapter 5

Induction and recursion. Chapter 5 Induction and recursion Chapter 5 Chapter Summary Mathematical Induction Strong Induction Well-Ordering Recursive Definitions Structural Induction Recursive Algorithms Mathematical Induction Section 5.1

More information

Predicate Calculus - Semantics 1/4

Predicate Calculus - Semantics 1/4 Predicate Calculus - Semantics 1/4 Moonzoo Kim CS Dept. KAIST moonzoo@cs.kaist.ac.kr 1 Introduction to predicate calculus (1/2) Propositional logic (sentence logic) dealt quite satisfactorily with sentences

More information

Computational Tasks and Models

Computational Tasks and Models 1 Computational Tasks and Models Overview: We assume that the reader is familiar with computing devices but may associate the notion of computation with specific incarnations of it. Our first goal is to

More information

Chapter 2: The Basics. slides 2017, David Doty ECS 220: Theory of Computation based on The Nature of Computation by Moore and Mertens

Chapter 2: The Basics. slides 2017, David Doty ECS 220: Theory of Computation based on The Nature of Computation by Moore and Mertens Chapter 2: The Basics slides 2017, David Doty ECS 220: Theory of Computation based on The Nature of Computation by Moore and Mertens Problem instances vs. decision problems vs. search problems Decision

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

Please give details of your calculation. A direct answer without explanation is not counted.

Please give details of your calculation. A direct answer without explanation is not counted. Please give details of your calculation. A direct answer without explanation is not counted. Your answers must be in English. Please carefully read problem statements. During the exam you are not allowed

More information

o is a type symbol. There are no other type symbols.

o is a type symbol. There are no other type symbols. In what follows, the article sets out two main interpretations of the formal logic of Principia Mathematica, one aims to be historical which will be called Principia L and the other is Church s interpretation

More information

1. Consider the conditional E = p q r. Use de Morgan s laws to write simplified versions of the following : The negation of E : 5 points

1. Consider the conditional E = p q r. Use de Morgan s laws to write simplified versions of the following : The negation of E : 5 points Introduction to Discrete Mathematics 3450:208 Test 1 1. Consider the conditional E = p q r. Use de Morgan s laws to write simplified versions of the following : The negation of E : The inverse of E : The

More information

Aside: Golden Ratio. Golden Ratio: A universal law. Golden ratio φ = lim n = 1+ b n = a n 1. a n+1 = a n + b n, a n+b n a n

Aside: Golden Ratio. Golden Ratio: A universal law. Golden ratio φ = lim n = 1+ b n = a n 1. a n+1 = a n + b n, a n+b n a n Aside: Golden Ratio Golden Ratio: A universal law. Golden ratio φ = lim n a n+b n a n = 1+ 5 2 a n+1 = a n + b n, b n = a n 1 Ruta (UIUC) CS473 1 Spring 2018 1 / 41 CS 473: Algorithms, Spring 2018 Dynamic

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

Algebras with finite descriptions

Algebras with finite descriptions Algebras with finite descriptions André Nies The University of Auckland July 19, 2005 Part 1: FA-presentability A countable structure in a finite signature is finite-automaton presentable (or automatic)

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

Section Summary. Predicate logic Quantifiers. Negating Quantifiers. Translating English to Logic. Universal Quantifier Existential Quantifier

Section Summary. Predicate logic Quantifiers. Negating Quantifiers. Translating English to Logic. Universal Quantifier Existential Quantifier Section 1.4 Section Summary Predicate logic Quantifiers Universal Quantifier Existential Quantifier Negating Quantifiers De Morgan s Laws for Quantifiers Translating English to Logic Propositional Logic

More information

A function is a special kind of relation. More precisely... A function f from A to B is a relation on A B such that. f (x) = y

A function is a special kind of relation. More precisely... A function f from A to B is a relation on A B such that. f (x) = y Functions A function is a special kind of relation. More precisely... A function f from A to B is a relation on A B such that for all x A, there is exactly one y B s.t. (x, y) f. The set A is called the

More information

23.1 Gödel Numberings and Diagonalization

23.1 Gödel Numberings and Diagonalization Applied Logic Lecture 23: Unsolvable Problems in Logic CS 4860 Spring 2009 Tuesday, April 14, 2009 The fact that Peano Arithmetic is expressive enough to represent all computable functions means that some

More information

Chapter 1. Logic and Proof

Chapter 1. Logic and Proof Chapter 1. Logic and Proof 1.1 Remark: A little over 100 years ago, it was found that some mathematical proofs contained paradoxes, and these paradoxes could be used to prove statements that were known

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

THE LANGUAGE OF FIRST-ORDER LOGIC (FOL) Sec2 Sec1(1-16)

THE LANGUAGE OF FIRST-ORDER LOGIC (FOL) Sec2 Sec1(1-16) THE LANGUAGE OF FIRST-ORDER LOGIC (FOL) Sec2 Sec1(1-16) FOL: A language to formulate knowledge Logic is the study of entailment relationslanguages, truth conditions and rules of inference. FOL or Predicate

More information

Logic: The Big Picture

Logic: The Big Picture Logic: The Big Picture A typical logic is described in terms of syntax: what are the legitimate formulas semantics: under what circumstances is a formula true proof theory/ axiomatization: rules for proving

More information

THE REAL NUMBERS Chapter #4

THE REAL NUMBERS Chapter #4 FOUNDATIONS OF ANALYSIS FALL 2008 TRUE/FALSE QUESTIONS THE REAL NUMBERS Chapter #4 (1) Every element in a field has a multiplicative inverse. (2) In a field the additive inverse of 1 is 0. (3) In a field

More information

ICS141: Discrete Mathematics for Computer Science I

ICS141: Discrete Mathematics for Computer Science I ICS141: Discrete Mathematics for Computer Science I Dept. Information & Computer Sci., Jan Stelovsky based on slides by Dr. Baek and Dr. Still Originals by Dr. M. P. Frank and Dr. J.L. Gross Provided by

More information

n CS 160 or CS122 n Sets and Functions n Propositions and Predicates n Inference Rules n Proof Techniques n Program Verification n CS 161

n CS 160 or CS122 n Sets and Functions n Propositions and Predicates n Inference Rules n Proof Techniques n Program Verification n CS 161 Discrete Math at CSU (Rosen book) Sets and Functions (Rosen, Sections 2.1,2.2, 2.3) TOPICS Discrete math Set Definition Set Operations Tuples 1 n CS 160 or CS122 n Sets and Functions n Propositions and

More information

Chapter 1 The Real Numbers

Chapter 1 The Real Numbers Chapter 1 The Real Numbers In a beginning course in calculus, the emphasis is on introducing the techniques of the subject;i.e., differentiation and integration and their applications. An advanced calculus

More information

Introduction to Turing Machines. Reading: Chapters 8 & 9

Introduction to Turing Machines. Reading: Chapters 8 & 9 Introduction to Turing Machines Reading: Chapters 8 & 9 1 Turing Machines (TM) Generalize the class of CFLs: Recursively Enumerable Languages Recursive Languages Context-Free Languages Regular Languages

More information

Predicate Logic - Introduction

Predicate Logic - Introduction Outline Motivation Predicate Logic - Introduction Predicates & Functions Quantifiers, Coming to Terms with Formulas Quantifier Scope & Bound Variables Free Variables & Sentences c 2001 M. Lawford 1 Motivation:

More information

Two New Definitions of Stable Models of Logic Programs with Generalized Quantifiers

Two New Definitions of Stable Models of Logic Programs with Generalized Quantifiers Two New Definitions of Stable Models of Logic Programs with Generalized Quantifiers Joohyung Lee and Yunsong Meng School of Computing, Informatics and Decision Systems Engineering Arizona State University,

More information

cse547, math547 DISCRETE MATHEMATICS Professor Anita Wasilewska

cse547, math547 DISCRETE MATHEMATICS Professor Anita Wasilewska cse547, math547 DISCRETE MATHEMATICS Professor Anita Wasilewska LECTURE 12 CHAPTER 4 NUMBER THEORY PART1: Divisibility PART 2: Primes PART 1: DIVISIBILITY Basic Definitions Definition Given m,n Z, we say

More information

FIRST ORDER SENTENCES ON G(n, p), ZERO-ONE LAWS, ALMOST SURE AND COMPLETE THEORIES ON SPARSE RANDOM GRAPHS

FIRST ORDER SENTENCES ON G(n, p), ZERO-ONE LAWS, ALMOST SURE AND COMPLETE THEORIES ON SPARSE RANDOM GRAPHS FIRST ORDER SENTENCES ON G(n, p), ZERO-ONE LAWS, ALMOST SURE AND COMPLETE THEORIES ON SPARSE RANDOM GRAPHS MOUMANTI PODDER 1. First order theory on G(n, p) We start with a very simple property of G(n,

More information

3/29/2017. Logic. Propositions and logical operations. Main concepts: propositions truth values propositional variables logical operations

3/29/2017. Logic. Propositions and logical operations. Main concepts: propositions truth values propositional variables logical operations Logic Propositions and logical operations Main concepts: propositions truth values propositional variables logical operations 1 Propositions and logical operations A proposition is the most basic element

More information

Preliminaries to the Theory of Computation

Preliminaries to the Theory of Computation Preliminaries to the Theory of Computation 2 In this chapter, we explain mathematical notions, terminologies, and certain methods used in convincing logical arguments that we shall have need of throughout

More information

3. The Logic of Quantified Statements Summary. Aaron Tan August 2017

3. The Logic of Quantified Statements Summary. Aaron Tan August 2017 3. The Logic of Quantified Statements Summary Aaron Tan 28 31 August 2017 1 3. The Logic of Quantified Statements 3.1 Predicates and Quantified Statements I Predicate; domain; truth set Universal quantifier,

More information

Today. Proof using contrapositive. Compound Propositions. Manipulating Propositions. Tautology

Today. Proof using contrapositive. Compound Propositions. Manipulating Propositions. Tautology 1 Math/CSE 1019N: Discrete Mathematics for Computer Science Winter 2007 Suprakash Datta datta@cs.yorku.ca Office: CSEB 3043 Phone: 416-736-2100 ext 77875 Course page: http://www.cs.yorku.ca/course/1019

More information

Foundations of Mathematics Worksheet 2

Foundations of Mathematics Worksheet 2 Foundations of Mathematics Worksheet 2 L. Pedro Poitevin June 24, 2007 1. What are the atomic truth assignments on {a 1,..., a n } that satisfy: (a) The proposition p = ((a 1 a 2 ) (a 2 a 3 ) (a n 1 a

More information

Math From Scratch Lesson 28: Rational Exponents

Math From Scratch Lesson 28: Rational Exponents Math From Scratch Lesson 28: Rational Exponents W. Blaine Dowler October 8, 2012 Contents 1 Exponent Review 1 1.1 x m................................. 2 x 1.2 n x................................... 2 m

More information

1. Write a program to calculate distance traveled by light

1. Write a program to calculate distance traveled by light G. H. R a i s o n i C o l l e g e O f E n g i n e e r i n g D i g d o h H i l l s, H i n g n a R o a d, N a g p u r D e p a r t m e n t O f C o m p u t e r S c i e n c e & E n g g P r a c t i c a l M a

More information

Definition: Let S and T be sets. A binary relation on SxT is any subset of SxT. A binary relation on S is any subset of SxS.

Definition: Let S and T be sets. A binary relation on SxT is any subset of SxT. A binary relation on S is any subset of SxS. 4 Functions Before studying functions we will first quickly define a more general idea, namely the notion of a relation. A function turns out to be a special type of relation. Definition: Let S and T be

More information

High School Algebra I Scope and Sequence by Timothy D. Kanold

High School Algebra I Scope and Sequence by Timothy D. Kanold High School Algebra I Scope and Sequence by Timothy D. Kanold First Semester 77 Instructional days Unit 1: Understanding Quantities and Expressions (10 Instructional days) N-Q Quantities Reason quantitatively

More information

Regularity-preserving letter selections

Regularity-preserving letter selections Regularity-preserving letter selections Armando B. Matos LIACC, Universidade do Porto Rua do Campo Alegre 823, 4150 Porto, Portugal 1 Introduction and definitions Seiferas and McNaughton gave in [SM76]

More information

Theory of Computation

Theory of Computation Fall 2002 (YEN) Theory of Computation Midterm Exam. Name:... I.D.#:... 1. (30 pts) True or false (mark O for true ; X for false ). (Score=Max{0, Right- 1 2 Wrong}.) (1) X... If L 1 is regular and L 2 L

More information

Individuals and Relations

Individuals and Relations Individuals and Relations It is useful to view the world as consisting of individuals (objects, things) and relations among individuals. Often features are made from relations among individuals and functions

More information

MATH 145 LECTURE NOTES. Zhongwei Zhao. My Lecture Notes for MATH Fall

MATH 145 LECTURE NOTES. Zhongwei Zhao. My Lecture Notes for MATH Fall MATH 145 LECTURE NOTES Zhongwei Zhao My Lecture Notes for MATH 145 2016 Fall December 2016 Lecture 1, Sept. 9 Course Orientation and Organization About the Professor Stephen New MC 5419 Ext 35554 Email:

More information