Bound and Free Variables. Theorems and Proofs. More valid formulas involving quantifiers:

Similar documents
Logic: The Big Picture

Regular Languages and Finite Automata

Propositional Logic: Syntax

Examples: P: it is not the case that P. P Q: P or Q P Q: P implies Q (if P then Q) Typical formula:

Logic. Propositional Logic: Syntax. Wffs

Logic. Propositional Logic: Syntax

Mathematical Logic. Reasoning in First Order Logic. Chiara Ghidini. FBK-IRST, Trento, Italy

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

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

Propositional Logic. Spring Propositional Logic Spring / 32

02 Propositional Logic

Chapter 1 Elementary Logic

COMP 2600: Formal Methods for Software Engineeing

First-Order Logic. 1 Syntax. Domain of Discourse. FO Vocabulary. Terms

Class 29 - November 3 Semantics for Predicate Logic

First Order Logic: Syntax and Semantics

Predicate Logic. Andreas Klappenecker

Learning Goals of CS245 Logic and Computation

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

Victoria Gitman and Thomas Johnstone. New York City College of Technology, CUNY

Introduction to Metalogic

Argument. whenever all the assumptions are true, then the conclusion is true. If today is Wednesday, then yesterday is Tuesday. Today is Wednesday.

Peano Arithmetic. CSC 438F/2404F Notes (S. Cook) Fall, Goals Now

CSCE 222 Discrete Structures for Computing. Predicate Logic. Dr. Hyunyoung Lee. !!!!! Based on slides by Andreas Klappenecker

Lecture Notes on DISCRETE MATHEMATICS. Eusebius Doedel

Completeness for FOL

First Order Logic: Syntax and Semantics

1.1 Statements and Compound Statements

Chapter 4: Classical Propositional Semantics

The Importance of Being Formal. Martin Henz. February 5, Propositional Logic

CITS2211 Discrete Structures Proofs

Gödel s Incompleteness Theorems

Math 267a - Propositional Proof Complexity. Lecture #1: 14 January 2002

Propositional Logic. Fall () Propositional Logic Fall / 30

Lecture 11: Measuring the Complexity of Proofs

MATH 363: Discrete Mathematics

Computational Logic. Recall of First-Order Logic. Damiano Zanardini

Propositional Logic: Review

Equivalence of Propositions

Deductive Systems. Lecture - 3

Propositional Logic: Part II - Syntax & Proofs 0-0

CHAPTER 2. FIRST ORDER LOGIC

Review for Midterm 1. Andreas Klappenecker

An Introduction to Modal Logic III

ICS141: Discrete Mathematics for Computer Science I

Propositional Calculus - Hilbert system H Moonzoo Kim CS Division of EECS Dept. KAIST

MAT2345 Discrete Math

First-Order Logic. Chapter Overview Syntax

All psychiatrists are doctors All doctors are college graduates All psychiatrists are college graduates

KB Agents and Propositional Logic

MCS-236: Graph Theory Handout #A4 San Skulrattanakulchai Gustavus Adolphus College Sep 15, Methods of Proof

Logic in Computer Science. Frank Wolter

Proofs. Chapter 2 P P Q Q

Todays programme: Propositional Logic. Program Fac. Program Specification

Artificial Intelligence. Propositional Logic. Copyright 2011 Dieter Fensel and Florian Fischer

Part I: Propositional Calculus

THE LOGIC OF COMPOUND STATEMENTS

COMP219: Artificial Intelligence. Lecture 19: Logic for KR

Chapter 7 R&N ICS 271 Fall 2017 Kalev Kask

Models of Computation,

15414/614 Optional Lecture 1: Propositional Logic

Herbrand Theorem, Equality, and Compactness

Knowledge base (KB) = set of sentences in a formal language Declarative approach to building an agent (or other system):

Predicate Logic: Sematics Part 1

Price: $25 (incl. T-Shirt, morning tea and lunch) Visit:

Marie Duží

First-Order Theorem Proving and Vampire

Mathematics 114L Spring 2018 D.A. Martin. Mathematical Logic

Completeness for FOL

How to determine if a statement is true or false. Fuzzy logic deal with statements that are somewhat vague, such as: this paint is grey.

CHAPTER 11. Introduction to Intuitionistic Logic

Description Logics. Foundations of Propositional Logic. franconi. Enrico Franconi

Advanced Topics in LP and FP

Informal Statement Calculus

CHAPTER 4 CLASSICAL PROPOSITIONAL SEMANTICS

CSE 1400 Applied Discrete Mathematics Proofs

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

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

First-Degree Entailment

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

Modal and temporal logic

Logic Overview, I. and T T T T F F F T F F F F

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

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

Introduction to Logic and Axiomatic Set Theory


Predicate Logic: Introduction and Translations

MAGIC Set theory. lecture 2

Natural Deduction for Propositional Logic

COMP219: Artificial Intelligence. Lecture 19: Logic for KR

COMP3702/7702 Artificial Intelligence Week 5: Search in Continuous Space with an Application in Motion Planning " Hanna Kurniawati"

MA Discrete Mathematics

1 Propositional Logic

Extensions to the Logic of All x are y: Verbs, Relative Clauses, and Only

Chapter 3. Formal Number Theory

University of Aberdeen, Computing Science CS2013 Predicate Logic 4 Kees van Deemter

Formal Logic: Quantifiers, Predicates, and Validity. CS 130 Discrete Structures

Propositional Logic Review

INF3170 Logikk Spring Homework #8 For Friday, March 18

1 Completeness Theorem for First Order Logic

Transcription:

Bound and Free Variables More valid formulas involving quantifiers: xp(x) x P(x) Replacing P by P, we get: x P(x) x P(x) Therefore x P(x) xp(x) Similarly, we have xp(x) x P(x) x P(x) xp(x) i(i 2 > i) is equivalent to j(j 2 > j): the i and j are bound variables, just like the i,j in What about i(i 2 = j): n i=1 i2 or n j=1 j2 the i is bound by i; the j is free. Its value is unconstrained. if the domain is the natural numbers, the truth of this formula depends on the value of j. 1 2 Theorems and Proofs Just as in propositional logic, there are axioms and proof rules that provide a complete axiomatization for firstorder logic, independent of the domain. A typical axiom: x(p(x) Q(x)) ( xp(x) xq(x)). Suppose we restrict the domain to the natural numbers, and allow only the standard symbols of arithmetic (+,, =, >, 0, 1). Typical true formulas include: x y(x y = x) x y(x = y + y x = y + y + 1) Let Prime(x) be an abbreviation for y z((x = y z) ((y = 1) (y = x))) Prime(x) is true if x is prime What does the following formula say: x( y(y > 1 x = y + y) z 1 z 2 (Prime(z 1 ) Prime(z 2 ) x = z 1 + z 2 )) This is Goldbach s conjecture: every even number other than 2 is the sum of two primes. Is it true? We don t know. Is there a sound and complete axiomatization for arithmetic? A small collection of axioms and inference rules such that every true formula of arithmetic can be proved from them Gödel s Theorem: NO! 3 4

Logic: The Big Picture Syntax and Semantics for Propositional Logic A typical logic is described in terms of syntax: what are the valid formulas semantics: under what circumstances is a formula true proof theory/ axiomatization: rules for proving a formula true Truth and provability are quite different. What is provable depends on the axioms and inference rules you use Provability is a mechanical, turn-the-crank process What is true depends on the semantics syntax: start with primitive propositions and close off under and (and,, if you want) semantics: need a truth assignment T formally: a function T that maps primitive propositions to {true, false}. define the truth of all formulas inductively logicians write T = A if formula A is true under truth assignment T typical inductive clauses: T = A B iff T = A and T = B T = A iff T = A 5 6 Tautologies and Valid Arguments When is an argument A 1 A 2. A n B valid? When the truth of the premises imply the truth of the conclusion How do you check if an argument is valid? Method 1: Take an arbitrary truth assignment v. Show that if A 1,...,A n are true under T (T = A 1,...v = A n ) then B is true under T. Method 2: Show that A 1... A n B is a tautology (essentially the same thing) true for every truth assignment Method 3: Try to prove A 1... A n B using a sound axiomatization A Sound and Complete Axiomatization for Propositional Logic All you need are two axioms schemes: Ax1. A (B A) Ax2. (A (B C) ((A B) (A C)) and one inference rule: Modus Ponens: From A B and A infer B Ax1 and Ax2 are axioms schemes: each one encodes an infinite set of axioms (obtained by plugging in arbitrary formulas for A, B, C A proof is a sequence of formulas A 1,A 2, A 3,... such that each A i is either 1. An instance of Ax1 and Ax2 2. Follows from previous formulas by applying MP that is, there exist A j, A k with j, k < i such that A j has the form A B, A k is A and A i is B. This axiomatization is sound and complete. everything provable is a tautology all tautologies are provable 7 8

First-Order Logic: Semantics How do we decide if a first-order formula is true? Need: a domain D (what are you quantifying over) an interpretation I that interprets the constants and predicate symbols: for each constant symbol c, I(c) D Which domain element is Alice? for each unary predicate P, I(P) is a predicate on domain D formally, I(P)(d) {true,false} for each d D Is Alice Tall? How about Bob? for each binary predicate Q, I(Q) is a predicate on D D: formally, I(Q)(d 1, d 2 ) {true,false} for each d 1, d 2 D Is Alice taller than Bob? a valuation V associating with each variable x and element V (x) D. To figure out if P(x) is true, you need to know what x is. Now we can define whether a formula A is true, given a domain D, an interpretation I, and a valuation V, written (I,D,V ) = A The definition is by induction: (I,D, V ) = P(x) if I(P)(V (x)) = true (I,D, V ) = P(c) if I(P)(I(c))) = true (I,D, V ) = xa if (I, D,V ) = A for all valuations V that agree with V except possibly on x V (y) = V (y) for all y x V (x) can be arbitrary (I,D, V ) = xa if (I,D,V ) = A for some valuation V that agrees with V except possibly on x. 9 10 Axiomatizing First-Order Logic Some Bureuacracy There s also an elegant complete axiomatization for firstorder logic. Again, the only inference rule is Modus Ponens Typical axiom: x(p(x) Q(x)) ( xp(x) xq(x)) Completeness was proved by Gödel in 1930 The final is on Thursday, May 13, 12-2:30 PM, in Philips 101 If you have conflicts (more than two exams in a 24- hour time period) let me know as soon as possible. We may schedule a makeup; or perhaps the other course will. Office hours go on as usual during study week, but check the course web site soon. There may be small changes to accommodate the TAs exams There will be a review session 11 12

Coverage of Final everything covered by the first prelim emphasis on more recent material Chapter 4: Fundamental Counting Methods Basic methods: sum rule, product rule, division rule Permutations and combinations Combinatorial identities (know Theorems 1 4 on pp. 310 314) Pascal s triangle Binomial Theorem (but not multinomial theorem) Balls and urns Inclusion-exclusion Pigeonhole principle Chapter 6: Probability: 6.1 6.5 (but not inverse binomial distribution) basic definitions: probability space, events conditional probability, independence, Bayes Thm. random variables 13 uniform, binomial, and Poisson distributions expected value and variance Markov + Chebyshev inequalities understanding Law of Large Numbers, Central Limit Theorem Chapter 7: Logic: 7.1 7.4, 7.6; *not* 7.5 translating from English to propositional (or firstorder) logic truth tables and axiomatic proofs algorithm verification first-order logic 14 Ten Powerful Ideas Counting: Count without counting (combinatorics) Induction: Recognize it in all its guises. Exemplification: Find a sense in which you can try out a problem or solution on small examples. Abstraction: Abstract away the inessential features of a problem. One possible way: represent it as a graph Modularity: Decompose a complex problem into simpler subproblems. Representation: Understand the relationships between different possible representations of the same information or idea. Graphs vs. matrices vs. relations Refinement: The best solutions come from a process of repeatedly refining and inventing alternative solutions. Toolbox: Build up your vocabulary of abstract structures. Optimization: Understand which improvements are worth it. Probabilistic methods: Flipping a coin can be surprisingly helpful! 15 16

Connections: Random Graphs Suppose we have a random graph with n vertices. How likely is it to be connected? What is a random graph? If it has n vertices, there are C(n, 2) possible edges, and 2 C(n,2) possible graphs. What fraction of them is connected? One way of thinking about this. Build a graph using a random process, that puts each edge in with probability 1/2. Now use the binomial theorem to compute (1 (3/4) n 2 ) n 1 (1 (3/4) n 2 ) n 1 = 1 (n 1)(3/4) n 2 + C(n 1, 2)(3/4) 2(n 2) + For sufficiently large n, this will be (just about) 1. Bottom line: If n is large, then it is almost certain that a random graph will be connected. Theorem: [Fagin, 1976] If P is any property expressible in first-order logic, it is either true in almost all graphs, or false in almost all graphs. This is called a 0-1 law. Given three vertices a, b, and c, what s the probability that there is an edge between a and b and between b and c? 1/4 What is the probability that there is no path of length 2 between a and c? (3/4) n 2 What is the probability that there is a path of length 2 between a and c? 1 (3/4) n 2 What is the probability that there is a path of length 2 between a and every other vertex? > (1 (3/4) n 2 ) n 1 17 18 Connection: First-order Logic Suppose you wanted to query a database. How do you do it? Modern database query language date back to SQL (structured query language), and are all based on first-order logic. The idea goes back to Ted Codd, who invented the notion of relational databases. Suppose you re a travel agent and want to query the airline database about whether there are flights from Ithaca to Santa Fe. How are cities and flights between them represented? How do we form this query? You re actually asking whether there is a path from Ithaca to Santa Fe in the graph. This fact cannot be expressed in first-order logic! 19