Discussion #15 1/16 Discussion #15 Interpretations.

Slides:



Advertisements
Similar presentations
Lexical Analysis, Regular Expressions & Finite State Machines.
Advertisements

The Logic of Quantified Statements
CS&E 1111 ExIFs IFs and Nested IFs in Excel Objectives: Using the If function in spreadsheets Nesting If functions.
Chapter 1: The Foundations: Logic and Proofs 1.1 Propositional Logic 1.2 Propositional Equivalences 1.3 Predicates and Quantifiers 1.4 Nested Quantifiers.
Truth Trees Intermediate Logic.
RMIT University; Taylor's College This is a story about four people named Everybody, Somebody, Anybody and Nobody. There was an important job to be done.
CS128 – Discrete Mathematics for Computer Science
Discussion #16 1/12 Discussion #16 Validity & Equivalences.
Discussion #22 1/10 Discussion #22 Relational Data Model.
Chapter Predicate Calculus Formal language –True/False statements –Supports reasoning Usage –Integrity constraints –Non-procedural query languages.
Chapter Predicate Calculus Formal language –True/False statements –Supports reasoning Usage –Integrity constraints –Non-procedural query languages.
First Order Logic (chapter 2 of the book) Lecture 3: Sep 14.
EE1J2 - Slide 1 EE1J2 – Discrete Maths Lecture 12 Number theory Mathematical induction Proof by induction Examples.
Thirteen conditional expressions: letting programs make “decisions”
Discussion #23 1/32 Discussion #23 Relational Algebra.
8-1 Copyright ©2011 Pearson Education, Inc. publishing as Prentice Hall Chapter 8 Confidence Interval Estimation Statistics for Managers using Microsoft.
Copyright ©2011 Pearson Education 8-1 Chapter 8 Confidence Interval Estimation Statistics for Managers using Microsoft Excel 6 th Global Edition.
Discrete Structures Chapter 3: The Logic of Quantified Statements
EE1J2 - Slide 1 EE1J2 – Discrete Maths Lecture 6 Limitations of propositional logic Introduction to predicate logic Symbols, terms and formulae, Parse.
CSE115/ENGR160 Discrete Mathematics 01/20/11 Ming-Hsuan Yang UC Merced 1.
EE1J2 - Slide 1 EE1J2 – Discrete Maths Lecture 11 Introduction to Predicate Logic Limitations of Propositional Logic Predicates, quantifiers and propositions.
First Order Logic. This Lecture Last time we talked about propositional logic, a logic on simple statements. This time we will talk about first order.
Section 1.3: Predicates and Quantifiers
Predicates & Quantifiers Goal: Introduce predicate logic, including existential & universal quantification Introduce translation between English sentences.
Chapter 1: The Foundations: Logic and Proofs
CSci 2011 Discrete Mathematics Lecture 3 CSci 2011.
DEDUCTIVE DATABASE.
START OF DAY 8 Reading: Chap. 2 & 9. Relational Data Model.
Discussion #141/20 Discussion #14 Predicate Calculus.
DECIDABILITY OF PRESBURGER ARITHMETIC USING FINITE AUTOMATA Presented by : Shubha Jain Reference : Paper by Alexandre Boudet and Hubert Comon.
Predicate Calculus. Calculus What does calculus mean? – Comes from the word “stone” – Implies a process of calculating Lots of calculus studies … – Differential.
First Order Predicate Calculus Chapter 7. Propositional logic v. FOPC §Propositional calculus deals only with facts l P : I-love-all-dogs l facts are.
1 Logical Agents CS 171/271 (Chapter 7) Some text and images in these slides were drawn from Russel & Norvig’s published material.
Slide 1 Propositional Definite Clause Logic: Syntax, Semantics and Bottom-up Proofs Jim Little UBC CS 322 – CSP October 20, 2014.
First Order Logic Lecture 2: Sep 9. This Lecture Last time we talked about propositional logic, a logic on simple statements. This time we will talk about.
Copyright © Curt Hill Quantifiers. Copyright © Curt Hill Introduction What we have seen is called propositional logic It includes.
Propositional Calculus CS 270: Mathematical Foundations of Computer Science Jeremy Johnson.
1 Logical Agents CS 171/271 (Chapter 7) Some text and images in these slides were drawn from Russel & Norvig’s published material.
1 Introduction to Abstract Mathematics Chapter 2: The Logic of Quantified Statements. Predicate Calculus Instructor: Hayk Melikya 2.3.
1 Introduction to Abstract Mathematics Proofs in Predicate Logic , , ~, ,  Instructor: Hayk Melikya Purpose of Section: The theorems.
Sets & Set Operations Tuples & Relations. Sets Sets are collections –The things in the collection are called elements or members –Sets have no duplicates.
1 Sections 1.3 and 1.4 Predicates & Quantifiers. 2 Propositional Functions In a mathematical assertion, such as x < 3, there are two parts: –the subject,
1 Introduction to Abstract Mathematics Predicate Logic Instructor: Hayk Melikya Purpose of Section: To introduce predicate logic (or.
1 Georgia Tech, IIC, GVU, 2006 MAGIC Lab Rossignac Lecture 02: QUANTIFIERS Sections 1.3 and 1.4 Jarek Rossignac CS1050:
CSS342: Quantifiers1 Professor: Munehiro Fukuda. CSS342: Quantifiers2 Review of Propositions Proposition: a statement that is either true or false, but.
Fall 2008/2009 I. Arwa Linjawi & I. Asma’a Ashenkity 1 The Foundations: Logic and Proofs Predicates and Quantifiers.
CS 285- Discrete Mathematics Lecture 4. Section 1.3 Predicate logic Predicate logic is an extension of propositional logic that permits concisely reasoning.
First Order Logic Lecture 3: Sep 13 (chapter 2 of the book)
Method of proofs.  Consider the statements: “Humans have two eyes”  It implies the “universal quantification”  If a is a Human then a has two eyes.
Semantics of Predicate Calculus For the propositional calculus, an interpretation was simply an assignment of truth values to the proposition letters of.
Predicate Logic One step stronger than propositional logic Copyright © Curt Hill.
Copyright © Peter Cappello 2011 Predicates & Quantifiers.
Albert Gatt LIN3021 Formal Semantics Lecture 3. Aims This lecture is divided into two parts: 1. We make our first attempts at formalising the notion of.
Week 4 - Friday.  What did we talk about last time?  Floor and ceiling  Proof by contradiction.
Section 1.5 and 1.6 Predicates and Quantifiers. Vocabulary Predicate Domain Universal Quantifier Existential Quantifier Counterexample Free variable Bound.
PREDICATES AND QUANTIFIERS COSC-1321 Discrete Structures 1.
Lecture 041 Predicate Calculus Learning outcomes Students are able to: 1. Evaluate predicate 2. Translate predicate into human language and vice versa.
1 Introduction to Abstract Mathematics Chapter 3: The Logic of Quantified Statements. Predicate Calculus Instructor: Hayk Melikya 3.1.
Relational Algebra. What is an algebra? –a pair: (set of values, set of operations) –  ADT  type  Class  Object e.g., stack: (set of all stacks, {pop,
Relational Data Model.
Predicates & Quantifiers
Predicate Calculus Discussion #14 Chapter 2, Section 1 1/20.
Discussion #14 Predicate Calculus
CS201: Data Structures and Discrete Mathematics I
Predicate Calculus Discussion #14 Chapter 2, Section 1.
Discrete Mathematics Lecture 4 & 5: Predicate and Quantifier
CS201: Data Structures and Discrete Mathematics I
Predicate Calculus. Predicate Calculus Topics Predicates Variables and instantiation Quantifiers Logical expressions Bound and free variables.
Representations & Reasoning Systems (RRS) (2.2)
Presentation transcript:

Discussion #15 1/16 Discussion #15 Interpretations

Discussion #15 2/16 Topics Interpretations Closed World Assumption Interpretation Examples for Class Project

Discussion #15 3/16 Interpretations Provide Meaning Consider the problem of giving meaning to the expression: sibling(x, Lynn)  married(x). –Can’t just assign T or F to a predicate expression with variables –Truth depends on the values assigned to the variables E.g. assign Zed to x; then if Zed is indeed Lynn’s sibling and is married, we can say that this expression is true. E.g. for  x(sibling(x, Lynn)  married(x)), we can look through the list of all possibilities (i.e. look through the domain) and see if at least one of them is a sibling of Lynn and is married; if so we can say that this expression is true. To provide an interpretation, we need –A domain that provides values for the arguments of the predicate –A way to determine the truth value of all predicates for each possible assignment of domain values to the variables

Discussion #15 4/16 Interpretation An interpretation for an expression E –Specify a domain, D. –For each predicate of E, specify T or F for every possible substitution. –Select a value in D for each free variable, if any. Example:  yP(x, y) D = {1, 2}P(x, y) = ? 1 1 T 1 2 F 2 1 F 2 2 F x = 1:  yP(x, y) = P(1, 1)  P(1, 2) = T  F = T x = 2:  yP(x, y) = P(2, 1)  P(2, 2) = F  F = F

Discussion #15 5/16 Interpretation An interpretation for an expression E –Specify a domain, D. –For each predicate of E, specify T or F for every possible substitution. –Select a value in D for each free variable, if any. Example:  yP(x, y) D = {1, 2}P(x, y) = ? 1 1 T 1 2 F 2 1 T 2 2 F x = 1:  yP(x, y) = P(1, 1)  P(1, 2) = T  F = T x = 2:  yP(x, y) = P(2, 1)  P(2, 2) = T  F = T Observe that the truth of a statement depends on the interpretation.

Discussion #15 6/16 Interpretation An interpretation for an expression E –Specify a domain, D. –For each predicate of E, specify T or F for every possible substitution. –Select a value in D for each free variable, if any. Example:  x  yP(x, y) D = {1, 2}P(x, y) = ? 1 1 T 1 2 F 2 1 F 2 2 F  x  yP(x, y) =  x(P(x, 1)  P(x, 2)) = (P(1, 1)  P(1, 2))  (P(2, 1)  P(2, 2)) = (T  F)  (F  F) = T  F = F

Discussion #15 7/16 Interpretation An interpretation for an expression E –Specify a domain, D. –For each predicate of E, specify T or F for every possible substitution. –Select a value in D for each free variable, if any. Example:  x  yP(x, y) D = {1, 2}P(x, y) = ? 1 1 T 1 2 F 2 1 T 2 2 F  x  yP(x, y) =  x(P(x, 1)  P(x, 2)) = (P(1, 1)  P(1, 2))  (P(2, 1)  P(2, 2)) = (T  F)  (T  F) = T  T = T

Discussion #15 8/16 Commonly Understood Predicates Sometimes we already know the domain and the T/F value for every substitution. Example:  y  x(x 2 +1 > y) –Assume we are discussing real numbers, so we know the domain. –Since we know the meaning of > and +, we know the T/F value for every substitution. –  y  x(x 2 +1 > y) = T (there is a y, e.g. 0 or 0.5 or …, such that for every x, x 2 +1 > y)

Discussion #15 9/16 Closed World Assumption With the closed world assumption, we only give the substitutions that evaluate to true — all others are assumed to be false. Let the domain, D = {1, 2}, then if we write: P(x, y) orP(1, 1) 1 1P(1, 2) 1 2 Then with the closed world assumption, this is simply shorthand for writing: P(x, y) = ?or 1 1 TP(1, 1) = T 2 1 FP(2, 1) = F 1 2 TP(1, 2) = T 2 2 FP(2, 2) = F

Discussion #15 10/16 Closed World Assumption Notes Our project uses the closed world assumption. –Only the substitutions that hold are given. –These are called facts. –Example, the facts in the Snoopy Database on the next slide Real-world databases use the closed world assumption  only “true” facts are stored. Contrary to the closed world assumption, the open world assumption says that if a fact is not stated, we do not know whether it is true or false. –The open world assumption is typical in everyday life. –It is harder to work with an open world assumption.

Discussion #15 11/16 Schemes: snap(S,N,A,P) csg(C,S,G) cp(C,Q) cdh(C,D,H) cr(C,R) Facts: snap('12345','C. Brown','12 Apple St.',' '). snap('67890','L. Van Pelt','34 Pear Ave.',' '). snap('22222','P. Patty','56 Grape Blvd.',' '). snap('33333','Snoopy','12 Apple St.',' '). csg('CS101','12345','A'). csg('CS101','67890','B'). csg('EE200','12345','C'). csg('EE200','22222','B+'). csg('EE200','33333','B'). csg('CS101','33333','A-'). csg('PH100','67890','C+'). cp('CS101','CS100'). cp('EE200','EE005'). cp('EE200','CS100'). cp('CS120','CS101'). cp('CS121','CS120'). cp('CS205','CS101'). cp('CS206','CS121'). cp('CS206','CS205'). cdh('CS101','M','9AM'). cdh('CS101','W','9AM'). cdh('CS101','F','9AM'). cdh('EE200','Tu','10AM'). cdh('EE200','W','1PM'). cdh('EE200','Th','10AM'). cdh('PH100','Tu','11AM'). cr('CS101','Turing Aud.'). cr('EE200','25 Ohm Hall'). cr('PH100','Newton Lab.'). Rules: WhoGradeCourse(N,G,C):-csg(C,S,G),snap(S,N,A,P). before(C1,C2):-cp(C2,C1). before(C1,C2):-cp(C3,C1),before(C3,C2). Queries: WhoGradeCourse('Snoopy',G,C)? WhoGradeCourse(N,'A','CS100')? WhoGradeCourse(N,'A',C)? before('CS100','CS206')? before('CS100',X)?

Discussion #15 12/16 Example #1 (Class Project) Query: What are the prerequisites of EE200? Translated to predicate logic, we are asking for: cp('EE200', x) where: cp(course, prerequisite) We need to find the substitutions for the free variable x, if any, that make this true. Interpretation for the project: –Domain = all constant strings –Closed world assumption holds (if stated as a fact, then T; otherwise, F).

Discussion #15 13/16 Example #1 (continued…) Check all substitutions for cp('EE200', x) from the domain for x: cp('EE200','10AM') = F cp('EE200','11AM') = F cp('EE200','12 Apple St.') = F … cp('EE200','CS100') = T x = 'CS100' … cp('EE200','EE005') = T x = 'EE005' … Also, –  x cp('EE200', x) = T –  x cp('EE200', x) = F –  x cp('CS100', x) = F cp Facts: cp('CS101','CS100'). cp('EE200','EE005'). cp('EE200','CS100'). cp('CS120','CS101'). cp('CS121','CS120'). cp('CS205','CS101'). cp('CS206','CS121'). cp('CS206','CS205').

Discussion #15 14/16 Example #2 (Class Project) Query: Where am I likely to find Charlie Brown ('12345') on Wednesday ('W') at 1 PM ('1PM')? Translated to predicate logic, we are asking for:  x  z(csg(x,'12345',z)  cr(x,r)  cdh(x,'W','1PM')) where: csg(course, studentID, grade) cr(course, room) cdh(course, day, hour) r is a free variable.

Discussion #15 15/16 Example #2 (continued…) Check substitutions for all combinations of values from the domain for x, z, and r: … csg('10AM','12345','10AM')  cr('10AM','10AM')  cdh('10AM','W','1PM') = F csg('10AM','12345','10AM')  cr('10AM','11AM')  cdh('10AM','W','1PM') = F csg('10AM','12345','10AM')  cr('10AM','12 Apple St.')  cdh('10AM','W','1PM') = F … csg('10AM','12345','11AM')  cr('10AM','10AM')  cdh('10AM','W','1PM') = F csg('10AM','12345','11AM')  cr('10AM','11AM')  cdh('10AM','W','1PM') = F csg('10AM','12345','11AM')  cr('10AM','12 Apple St.')  cdh('10AM','W','1PM') = F … csg('11AM','12345','10AM')  cr('11AM','10AM')  cdh('11AM','W','1PM') = F csg('11AM','12345','10AM')  cr('11AM','11AM')  cdh('11AM','W','1PM') = F csg('11AM','12345','10AM')  cr('11AM','12 Apple St.')  cdh('11AM','W','1PM') = F … csg('11AM','12345','11AM')  cr('11AM','10AM')  cdh('11AM','W','1PM') = F csg('11AM','12345','11AM')  cr('11AM','11AM')  cdh('11AM','W','1PM') = F csg('11AM','12345','11AM')  cr('11AM','12 Apple St.')  cdh('11AM','W','1PM') = F …

Discussion #15 16/16 Example #2 (continued…) Eventually, we check the substitution x = 'EE220', z = 'C', and r = '25 Ohm Hall'. csg('EE220','12345','C')  cr('EE220','25 Ohm Hall')  cdh('EE220','W','1PM') = T Thus, Charlie Brown is likely to be in 25 Ohm Hall on Wednesday at 1 PM. csg, cdh, and cr Facts: csg('CS101','12345','A'). csg('CS101','67890','B'). csg('EE200','12345','C'). csg('EE200','22222','B+'). csg('EE200','33333','B'). csg('CS101','33333','A-'). csg('PH100','67890','C+'). cdh('CS101','M','9AM'). cdh('CS101','W','9AM'). cdh('CS101','F','9AM'). cdh('EE200','Tu','10AM'). cdh('EE200','W','1PM'). cdh('EE200','Th','10AM'). cdh('PH100','Tu','11AM'). cr('CS101','Turing Aud.'). cr('EE200','25 Ohm Hall'). cr('PH100','Newton Lab.').