CS112 Friday, September 12, 2008

Similar documents
PHIL 240, Introduction to Logic, Sections Fall 2011 FINAL EXAM 14 December Name (5 points): Section (5 points):

Chapter 1.3 Quantifiers, Predicates, and Validity. Reading: 1.3 Next Class: 1.4. Motivation

Intermediate Logic. Natural Deduction for FOL

Quantification. Using the suggested notation, symbolize the statements expressed by the following sentences.

Back to the knights and knaves island

Practice Problems: All Computer Science majors are people. Some computer science majors are logical thinkers. Some people are logical thinkers.

Lecture 5: Predicate Calculus. ffl Predicate Logic ffl The Language ffl Semantics: Structures

Today s Lecture 4/13/ WFFs/ Free and Bound Variables 9.3 Proofs for Pred. Logic (4 new implicational rules)!

CITS2211 Discrete Structures Logic

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

Lecture 9: Predicate Logic. First: Finish Propositional Logic in Haskell. Semantics in Haskell. Syntax In Haskell. CS 181O Spring 2016 Kim Bruce

Intermediate Logic. Interpretations

CSE Discrete Structures

Notes on Predicate Calculus

Computation Club: Gödel s theorem

Notes. Notes. Introduction. Notes. Propositional Functions. Slides by Christopher M. Bourke Instructor: Berthe Y. Choueiry.

Multi-Place Predicates and Multiple Quantifiers

Homework 1. Due Date: Wednesday 11/26/07 - at the beginning of the lecture

Automated Reasoning. Natural Deduction in First-Order Logic

CPSC 121: Models of Computation. Module 5: Predicate Logic

Going beyond propositional logic

(l) Represent each of the sets A, B and C using bit strings. Then, use bit string representation and bitwise logical operations to find

Strategies for Proofs

ARTIFICIAL INTELLIGENCE (CS 370D)

Section 2.4: Arguments with Quantified Statements

For next Tuesday. Read chapter 8 No written homework Initial posts due Thursday 1pm and responses due by class time Tuesday

CSI30. Chapter 1. The Foundations: Logic and Proofs Rules of inference with quantifiers Logic and bit operations Specification consistency

ITCS 6150 Intelligent Systems. Lecture 13 First-Order Logic Chapter 8

, ->, and <-> just as atomic sentence letter (which we can still

CPSC 121 Midterm 1 Friday October 14th, Signature: Section (circle one): 11:00 15:30 17:00

Semantics and Pragmatics of NLP

Discrete Mathematics and Probability Theory Fall 2016 Seshia and Walrand Midterm 1

Surfaces and Partial Derivatives

6.034 Notes: Section 10.1

Software Paradigms (Lesson 6) Logic Programming

Discrete structures - CS Fall 2017 Questions for chapter 2.1 and 2.2

Logic Programming Paradigm

HOW TO DIVIDE: MCC6.NS.2 Fluently divide multi-digit numbers using the standard algorithm. WORD DEFINITION IN YOUR WORDS EXAMPLE

1.3 Primitive Recursive Predicates and Bounded Minimalization

CS40-S13: Functional Completeness

We imagine the egg being the three dimensional solid defined by rotating this ellipse around the x-axis:

Surfaces and Partial Derivatives

CSL105: Discrete Mathematical Structures. Ragesh Jaiswal, CSE, IIT Delhi

CMPSCI 250: Introduction to Computation. Lecture #7: Quantifiers and Languages 6 February 2012

Section 2.2: Introduction to the Logic of Quantified Statements

Question about Final Exam. CS 416 Artificial Intelligence. What do we like about propositional logic? First-order logic

First Order Predicate Logic CIS 32

Mini-Project 1: The Library of Functions and Piecewise-Defined Functions

First Order Logic Part 1

Predicate Logic CHAPTER What This Chapter Is About

Constraint Propagation for Efficient Inference in Markov Logic

Truth Trees. Truth Tree Fundamentals

Definition MATH Benjamin V.C. Collins, James A. Swenson MATH 2730

September 08, Graph y 2 =x. How? Is it a function? Function?

Deduction Rule System vs Production Rule System. Prof. Bob Berwick. Rules Rule

Paste them together (lining up the x-axis in each piece) to create the graph of the piecewise-defined function.

The Specification Phase

UNIVERSITY OF CALIFORNIA Department of Electrical Engineering and Computer Sciences Computer Science Division. P. N. Hilfinger

Exam 1 Review. MATH Intuitive Calculus Fall Name:. Show your reasoning. Use standard notation correctly.

CS 540: Introduction to Artificial Intelligence

CSE413 Midterm. Question Max Points Total 100

Name: CSCI E-220: Artificial Intelligence Midterm Exam, Fall Term 2001

Mathematical Logic Part Two

CSE20: Discrete Mathematics

CS150 - Sample Final

Part II Composition of Functions

Math 213 Calculus III Practice Exam 2 Solutions Fall 2002

CSE 311: Foundations of Computing. Lecture 8: Predicate Logic Proofs

7. Relational Calculus (Part I) 7.1 Introduction

A Brief Guide to MacLogic

Formal Predicate Calculus. Michael Meyling

Introductory logic and sets for Computer scientists

Propositional Logic. Part I

Practice Final. Read all the problems first before start working on any of them, so you can manage your time wisely

Continuity and Tangent Lines for functions of two variables

Intro. Scheme Basics. scm> 5 5. scm>

Chapter 2 & 3: Representations & Reasoning Systems (2.2)

1 Truth. 2 Conditional Statements. Expressions That Can Evaluate to Boolean Values. Williams College Lecture 4 Brent Heeringa, Bill Jannen

Predicate Logic and Quan0fies

Resolution (14A) Young W. Lim 6/14/14

CSE 473 Lecture 12 Chapter 8. First-Order Logic. CSE AI faculty

Precomposing Equations

Lecture 4: January 12, 2015

Discrete Mathematics and Probability Theory Spring 2016 Rao and Walrand Midterm 1

First-Order Logic PREDICATE LOGIC. Syntax. Terms

First-Order Logic Syntax

To figure this out we need a more precise understanding of how ML works

What is a Logic Program. Introduction to Logic Programming. Introductory Examples. Introductory Examples. Foundations, First-Order Language

Introduction to Logic Programming

Have the students look at the editor on their computers. Refer to overhead projector as necessary.

First-Order Translation Checklist

We have written lots of code so far It has all been inside of the main() method What about a big program? The main() method is going to get really

1. true / false By a compiler we mean a program that translates to code that will run natively on some machine.

CS150 Sample Final. Name: Section: A / B

Spring 2018 CSE191 Midterm Exam I

Binary Relations Part One

Section 1.1 Logic LOGIC

Programming Languages Third Edition

Vibhav Gogate University of Texas, Dallas Artificial Intelligence: CS 4365 First-order Logic

Introduction to Prolog

Transcription:

CS112 Friday, September 12, 2008 Agenda Natural Deduction Questions FOL Translations FOL Interpretations Natural Deduction Questions? First Order Logic Translations Symbolization Key Universe of Discourse (UD) tells us what we can talk about Predicates Individual Constants Translations Rules and Pointers Scope In order for a sentence in FOL to be well-formed (called a wff ), there cannot be any unbound variables. All variables must fall within the scope of a quantifier. The scope includes the quantifier itself (the x in x is bound) and the formula that immediately follows the quantifier. Use parentheses to extend the scope of a quantifier Complex Translations When faced with a tough translation, try breaking it down into smaller parts. What is the main operator in the sentence? Keep rewriting the translation when you add a quantifier or figure out a main operator until it is obvious how to fill in the pieces Example Pit Bulls are dangerous, but Labradors are not. Conjunction Both pit bulls are dangerous and Labradors are not dangerous.

Both no matter what x I choose, if x is a pit bull then x is dangerous and no matter what y I choose, if y is a Labrador then it is not the case that y is dangerous. Note that it would have been perfectly legal to use x as the only variable in this sentence because the second time it is used (for Labradors) it is not within the same scope as the first quantifier. But it s a good practice to use different variables even if you don t have to ( x)(px Dx) & ( y)(ly ~Dy) When to stack quantifiers To be safe, try to give your quantifiers the smallest scope possible. If you must stack your quantifiers at the beginning of the sentence, use the equivalences to do so. English Symbols UD: people Lxy: x loves y Hxy: x hits y Ixy: x insults y Lx: x is a lawyer Gx: x wears green Jx: x would be a good judge Cx: x is crazy Jx: x is a judge Fx: x is fat (1) No crazy lawyer insults any fat judge. ~ x(cx & Lx & y(fy & Jy & Ixy)) (2) No crazy lawyer insults every fat judge. ~ x(cx & Lx & y((fy & Jy) Ixy)) (3) No crazy lawyer loves any judge whom she insults.

It is not the case that there is some x such that x is a crazy lawyer and x loves some judge whom x insults. ~ x(cx & Lx & there is some y such that y is a judge and x insults y and x loves y) ~ x(cx & Lx & y(jy & Ixy & Lxy)) (4) Some crazy lawyer insults every fat judge whom she loves. There is some x such that x is a crazy lawyer and x insults every fat judge that x loves. x(cx & Lx & for every y, if y is a fat judge and x loves y, then x insults y) x(cx & Lx & y((jy & Fy) & Lxy) Ixy)) No lawyer hits any judge whom she loves unless she s crazy. Ambiguous! Who does she refer to? Case 1: She refers back to the lawyer ~ x(x is a lawyer and x is not crazy and x hits some judge whom x loves) == Only a crazy lawyer would hit a judge that the lawyer loves. ~ x(lx & ~Cx & y(jy & Lxy & Hxy)) Case 2: She refers to the judge ~ x(x is a lawyer and x hits some judge whom x loves who is not crazy.) ~ x(lx & y(jy & Lxy & ~Cy & Hxy)) Symbols English (1) x(cx & Lx & y((fy & Jy) Ixy)) Some crazy lawyer insults every fat judge. (2) x(cx & Lx & y(fy & Jy & Ixy)) Some crazy lawyer insults some fat judge (3) x[(lx & ~Cx) y(ly & ~Jy & Ixy)]

Every lawyer who is not crazy insults some lawyer who would not be a good judge. Stacking quantifiers UD: positive integers Lxy: x is larger than y (1) For every integer, there is a greater integer. x ylyx (2) There is an integer that is greater than every integer. x ylxy (3) If the product of two integers is even, then at least one of them is even. Pxyz: x is the product of y and z, Ex: x is even x y z((pxyz ^ Ex) (Ey v Ez)) (4) No product of prime numbers is prime. ~( x)( y)((px&py)&pxy) First Order Logic Interpretations Review In propositional logic, every line of a truth table is an interpretation. FOL In FOL, we need to provide an interpretation function for each predicate and individual constant. Example Interpretation UD: positive integers Ox: {x x is odd} == {1, 3, 5, } Ex: {x x is even} == {2, 4, 6, } Lxy: {x y x is larger than y} == {{2,1}, {3,2}, {3, 1}, {4,3}, a: 1, b: 2 c: 3 Diagrams

Since truth tables aren t helpful for FOL semantics, using diagrams to model sentences can tell us if they are true or false for a given interpretation or model. (1) Any 1-place predicate is represented with a circle. (2) Any individual constant is represented with a dot. (3) 2-place predicates are represented with an arrow. When do we use these? Show that a set of sentences is consistent. If you can draw a diagram for a set of sentences, then we know there is at least one interpretation where all the sentences are true. == Consistency Show that an argument is valid If you make all of the premises of an argument true in a diagram, but you are able to make the conclusion false, then the argument is not valid. Examples Show that the following are consistent. { x(fx ygyx), x(gxx Fx), x y(gxy Gxx), x y z(fx & Gyz)} To show that this is consistent, provide an interpretation where all the sentences are true. (1) Start with 1 dot to represent something in the domain. (2) Fill in the diagram as needed to make each sentence true. Existentials tell us something about the world, so they add to the diagram Universals are more like tests. (3) As you add to the diagram, look for triggered sentences. (4) When you think you re done, check all the sentences. (5) Write up the interpretation.

{ x yfxy, x(gx yfyx), xgx, x~fxx} { x(px v Qx) xrx, x(rx Qx), x(px & ~Qx) Examples Show that the following arguments are valid. { xfxx v x ygxy, x y(fxy Gyx)} = xgxx What we want to find is an interpretation where the premises are true and the conclusion is false (~ xgxx) { x y(fxy yfyx), x yfxy, x y(fyx Fxx)} = xfxx