CSE 415 -- (c) S. Tanimoto, 2008 Predicate Calculus I 1 Predicate Calculus 1 Motivation Basics Encoding.

Slides:



Advertisements
Similar presentations
Artificial Intelligence
Advertisements

Biointelligence Lab School of Computer Sci. & Eng.
Standard Logical Equivalences
Logic Use mathematical deduction to derive new knowledge.
Section 1.3. More Logical Equivalences Constructing New Logical Equivalences We can show that two expressions are logically equivalent by developing.
Knowledge Representation
Predicate Calculus Formal Methods in Verification of Computer Systems Jeremy Johnson.
Knowledge Representation Methods
AI - Week 13 Knowledge Representation, Logic, Semantic Web Lee McCluskey, room 2/07
Outline Recap Knowledge Representation I Textbook: Chapters 6, 7, 9 and 10.
CSE (c) S. Tanimoto, 2008 Propositional Logic
AI - Week 16 Logic and Reasoning in AI: Resolution Refutation Lee McCluskey, room 2/07
Inference and Resolution for Problem Solving
1 Chapter 7 Propositional and Predicate Logic. 2 Chapter 7 Contents (1) l What is Logic? l Logical Operators l Translating between English and Logic l.
Modelling Conceptual Knowledge using Logic - Week 6 Lee McCluskey Department of Computing and Mathematical Sciences University of Huddersfield.
1 Knowledge Representation and Reasoning. 2 Knowledge Representation & Reasoning How knowledge about the world can be represented How knowledge about.
CSE115/ENGR160 Discrete Mathematics 01/20/11 Ming-Hsuan Yang UC Merced 1.
CIA2326 Week4: Predicate Logic : introduction Lee McCluskey, room 2/07
Introduction to Logic for Artificial Intelligence Lecture 2 Erik Sandewall 2010.
Predicates and Quantifiers
CSE 311 Foundations of Computing I Lecture 6 Predicate Logic, Logical Inference Spring
Chapter 1: The Foundations: Logic and Proofs
The Foundations: Logic and Proofs
CSE PredLogic 1 Knowledge Representation with Logic: First Order Predicate Calculus Outline –Introduction to First Order Predicate Calculus (FOPC)
1 Chapter 8 Inference and Resolution for Problem Solving.
CSCE 4613 Artificial Inteligence
Declarative vs Procedural Programming  Procedural programming requires that – the programmer tell the computer what to do. That is, how to get the output.
Chapter 1, Part II: Predicate Logic With Question/Answer Animations.
1 Section 7.2 Equivalent Formulas Two wffs A and B are equivalent, written A  B, if they have the same truth value for every interpretation. Property:
CSE S. Tanimoto Horn Clauses and Unification 1 Horn Clauses and Unification Propositional Logic Clauses Resolution Predicate Logic Horn Clauses.
Chapter 1, Part II: Predicate Logic With Question/Answer Animations.
CSE (c) S. Tanimoto, 2005 Knowledge Representation 1 Knowledge Representation (Introduction) Knowledge Information Data Knowledge representation:
1 Predicate (Relational) Logic 1. Introduction The propositional logic is not powerful enough to express certain types of relationship between propositions.
CS Introduction to AI Tutorial 8 Resolution Tutorial 8 Resolution.
CSE 311 Foundations of Computing I Lecture 7 Logical Inference Autumn 2012 CSE
Word Problem Consider the following problem: To register, you will need either a yellow card or a note from the Dean. To obtain a note from the Dean you.
The Law of Resolution Formal Aspects of Computer Science - Week 7 The Law of Resolution Lee McCluskey, room 2/07
ARTIFICIAL INTELLIGENCE [INTELLIGENT AGENTS PARADIGM] Professor Janis Grundspenkis Riga Technical University Faculty of Computer Science and Information.
1 Section 6.2 Propositional Calculus Propositional calculus is the language of propositions (statements that are true or false). We represent propositions.
1 Outline Quantifiers and predicates Translation of English sentences Predicate formulas with single variable Predicate formulas involving multiple variables.
Instructor: Eyal Amir Grad TAs: Wen Pu, Yonatan Bisk Undergrad TAs: Sam Johnson, Nikhil Johri CS 440 / ECE 448 Introduction to Artificial Intelligence.
1 Section 7.1 First-Order Predicate Calculus Predicate calculus studies the internal structure of sentences where subjects are applied to predicates existentially.
March 3, 2016Introduction to Artificial Intelligence Lecture 12: Knowledge Representation & Reasoning I 1 Back to “Serious” Topics… Knowledge Representation.
Introduction to Logic for Artificial Intelligence Lecture 2
Formal Modeling Concepts
Knowledge Representation and Reasoning
CSE 341, S. Tanimoto Logic Programming -
The function of knowledge representation scheme is
Proposition & Predicates
Horn Clauses and Unification
Chapter 1 The Foundations: Logic and Proofs
The Foundations: Logic and Proofs
CS201: Data Structures and Discrete Mathematics I
CSE 311 Foundations of Computing I
Logic Use mathematical deduction to derive new knowledge.
Horn Clauses and Unification
Horn Clauses and Unification
Back to “Serious” Topics…
Horn Clauses and Unification
Reasoning with the Propositional Calculus
Reasoning with the Propositional Calculus
Horn Clauses and Unification
Predicates and Quantifiers
Encoding Knowledge with First Order Predicate Logic
Reasoning with the Propositional Calculus
Reasoning with the Propositional Calculus
Encoding Knowledge with First Order Predicate Logic
CS201: Data Structures and Discrete Mathematics I
RESOLUTION.
Encoding Knowledge with First Order Predicate Logic
Presentation transcript:

CSE (c) S. Tanimoto, 2008 Predicate Calculus I 1 Predicate Calculus 1 Motivation Basics Encoding

CSE (c) S. Tanimoto, 2008 Predicate Calculus I 2 Motivation: More Accurate and General Representations of Knowledge “If Willy is a bird, then Willie can fly.” Propositional calculus: P: Willy is a bird Q: Willy can fly P  Q “Any bird can fly.” Predicate calculus  x (Bird(x)  CanFly(x) )

CSE (c) S. Tanimoto, 2008 Predicate Calculus I 3 Another Example “John’s grandfather was a blacksmith, and his mother was a seamstress.” Propositional calculus: P 1 : John’s grandfather was a blacksmith. P 2 : John’s grandmother was a seamstress. P  Q Predicate calculus: Q 1 (x): x is a blacksmith. Q 2 (x): x is a seamstress. f(x): grandfather of x. Q 1 (f(x))  Q 2 (m(x))

CSE (c) S. Tanimoto, 2008 Predicate Calculus I 4 Terminology of the Predicate Calculus Predicate symbols: P, Q, R, P 1, P 2,..., Q 1, Q 2,..., R 1, R 2,... If P takes n arguments, we call P an n-ary predicate P( term 1, term 2,..., term n ) n  0 Function symbols: f, g, h, f 1, f 2,..., g 1, g 2,..., h 1, h 2,... A term is either: a constant: e.g., a, b, c, a 1, a 2,..., b 1, b 2,..., c 1, c 2,... a variable: e.g., x, y, z, x 1, x 2,..., y 1, y 2,..., z 1, z 2,... an n-ary function symbol, followed by n terms in parentheses. Examples of terms: x, a, f(x), g 1 (a, y), h(f(x), g(y, b))

CSE (c) S. Tanimoto, 2008 Predicate Calculus I 5 Well-Formed Formulas Atomic formula: an n-ary predicate symbol followed by n terms in parentheses: e.g., P(x, f(x, a, y)) If F is an atomic formula, then it is a well-formed formula (WFF). Compound formula: a statement formed from one or more WFFs using logical connectives. If F is a compound formula, then it is a WFF. e.g., P(x, f(x, a, y)) v (Q  R(x)) Quantified formula: a statement formed from a WFFs by prefixing it with a quantifier and a variable. e.g., (  x) (P(x, f(x, a, y)) v (Q  R(x))) (  y) Q(y) If F is a quantified formula, then it is a WFF.

CSE (c) S. Tanimoto, 2008 Predicate Calculus I 6 A Syllogism for Predicate Logic Resolution Coloured flowers are always scented. I dislike flowers that are not grown in the open air. No flowers grown in the open air are colourless. Therefore, I dislike all flowers that are not scented. Lewis Carroll

CSE (c) S. Tanimoto, 2008 Predicate Calculus I 7 Encoding the Syllogism Predicate symbols: C(x) = x “is coloured.” S(x) = x “is scented.” D(x) = “I dislike” x. A(x) = x “is grown in the open air.”

CSE (c) S. Tanimoto, 2008 Predicate Calculus I 8 Encoding the Syllogism Coloured flowers are always scented. (  x) ( C(x)  S(x) ) I dislike flowers that are not grown in the open air. (  x) (  A(x)  D(x) ) No flowers grown in the open air are colourless. (  x) ( A(x)   C(x) ) Therefore, I dislike all flowers that are not scented. (  x) (  S(x)  D(x) )

CSE (c) S. Tanimoto, 2008 Predicate Calculus I 9 Proof by Resolution: (1) Negate the conclusion Coloured flowers are always scented. (  x) ( C(x)  S(x) ) I dislike flowers that are not grown in the open air. (  x) (  A(x)  D(x) ) No flowers grown in the open air are colourless. (  x) ( A(x)   C(x) ) It is not the case that I dislike all flowers that are not scented.  (  x) (  S(x)  D(x) )

CSE (c) S. Tanimoto, 2008 Predicate Calculus I 10 Proof by Resolution: (2) Obtain Clause Form Coloured flowers are always scented. (  x) ( C(x)  S(x) ) (  x) (  C(x) v S(x) ) Rewrite  using  and v.  C(x) v S(x) Drop leading universal quant. The other clauses are: A(x) v D(x)  A(x) v C(x) (  x)  (  S(x)  D(x) ) Move negation inward (  x) (  S(x)   D(x) ) DeMorgan’s law  S(a)   D(a) Introduce Skolem constant S(a  S(a),  D(a) Break into 2 clauses.

CSE (c) S. Tanimoto, 2008 Predicate Calculus I 11 Proof by Resolution: (3) Resolve P1:  C(x) v S(x) P2: A(y) v D(y) variables are standardized apart. P3:  A(z) v C(z) P4:  S(a) P5:  D(a) P6: A(a) P2, P5 { a/y } P7: C(a) P3, P6 { a/z } P8: S(a) P1, P7 { a/x } P9: [] P4, P8 { }

CSE (c) S. Tanimoto, 2008 Predicate Calculus I 12 “Encoding” One of the most difficult parts of creating an AI system: Encoding = Formulating a logical representation of the relevant information that can be used to efficiently make the desired kinds of inferences.

CSE (c) S. Tanimoto, 2008 Predicate Calculus I 13 Steps in Encoding 1.Have the class of problems to be solved written down (in English) 2.Have the knowledge to be represented written down (in English) 3.Specify a domain of values or objects over which will be represented by terms (constants, variables, and functions). 4.Structure the domain by introducing predicates that separate the domain into the subsets meaningful for the application. 5.Determine whether there are useful functional relationships among any domain elements, and if so, introduce functions that express these relationships. 6.Develop WFFs based on the chosen predicates and functions to best capture the desired knowledge.

CSE (c) S. Tanimoto, 2008 Predicate Calculus I 14 Example Represent the following information using the predicate calculus in a form that captures most of the individual facts and which supports the inference presented: “Each University of Central Lake Union (UCLU) building must either have an emergency rowboat or be in violation of the Lake Quake code. Any building in violation of the Lake Quake code will be temporarily closed. The annex of Schwimmschach Hall has dinghies but no emergency rowboats. Therefore the annex of Schwimmschach Hall will be temporarily closed.”

CSE (c) S. Tanimoto, 2008 Predicate Calculus I 15 Specifying the Domain “Each University of Central Lake Union (UCLU) building must either have an emergency rowboat or be in violation of the Lake Quake code. Any building in violation of the Lake Quake code will be temporarily closed. The annex of Schwimmschach Hall has dinghies but no emergency rowboats. Therefore the annex of Schwimmschach Hall will be temporarily closed.” Domain:

CSE (c) S. Tanimoto, 2008 Predicate Calculus I 16 Specifying the Domain “Each University of Central Lake Union (UCLU) building must either have an emergency rowboat or be in violation of the Lake Quake code. Any building in violation of the Lake Quake code will be temporarily closed. The annex of Schwimmschach Hall has dinghies but no emergency rowboats. Therefore the annex of Schwimmschach Hall will be temporarily closed.” Domain: BUILDINGS U BOATS BUILDINGS – restricted to buildings belonging to the University of Central Lake Union. This restriction will reduce the number of subsets needed. BOATS – all normal boats. Restriction to UCLU seems unnecessary. Subsets: ANNEXES, ROWBOATS, DINGHIES

CSE (c) S. Tanimoto, 2008 Predicate Calculus I 17 Subdomain Predicates “Each University of Central Lake Union (UCLU) building must either have an emergency rowboat or be in violation of the Lake Quake code. Any building in violation of the Lake Quake code will be temporarily closed. The annex of Schwimmschach Hall has dinghies but no emergency rowboats. Therefore the annex of Schwimmschach Hall will be temporarily closed.”

CSE (c) S. Tanimoto, 2008 Predicate Calculus I 18 Subdomain Predicates “Each University of Central Lake Union (UCLU) building must either have an emergency rowboat or be in violation of the Lake Quake code. Any building in violation of the Lake Quake code will be temporarily closed. The annex of Schwimmschach Hall has dinghies but no emergency rowboats. Therefore the annex of Schwimmschach Hall will be temporarily closed.” isBuilding(x), isRowboat(x), isAnnex(x), isDinghy(x)

CSE (c) S. Tanimoto, 2008 Predicate Calculus I 19 Properties “Each University of Central Lake Union (UCLU) building must either have an emergency rowboat or be in violation of the Lake Quake code. Any building in violation of the Lake Quake code will be temporarily closed. The annex of Schwimmschach Hall has dinghies but no emergency rowboats. Therefore the annex of Schwimmschach Hall will be temporarily closed.” Properties:

CSE (c) S. Tanimoto, 2008 Predicate Calculus I 20 Properties “Each University of Central Lake Union (UCLU) building must either have an emergency rowboat or be in violation of the Lake Quake code. Any building in violation of the Lake Quake code will be temporarily closed. The annex of Schwimmschach Hall has dinghies but no emergency rowboats. Therefore the annex of Schwimmschach Hall will be temporarily closed.” Properties: inViolation(x): x is in violation of the Lake Quake code. tempClosed(x): x will be temporarily closed.

CSE (c) S. Tanimoto, 2008 Predicate Calculus I 21 Constants “Each University of Central Lake Union (UCLU) building must either have an emergency rowboat or be in violation of the Lake Quake code. Any building in violation of the Lake Quake code will be temporarily closed. The annex of Schwimmschach Hall has dinghies but no emergency rowboats. Therefore the annex of Schwimmschach Hall will be temporarily closed.” Constants:

CSE (c) S. Tanimoto, 2008 Predicate Calculus I 22 Constants “Each University of Central Lake Union (UCLU) building must either have an emergency rowboat or be in violation of the Lake Quake code. Any building in violation of the Lake Quake code will be temporarily closed. The annex of Schwimmschach Hall has dinghies but no emergency rowboats. Therefore the annex of Schwimmschach Hall will be temporarily closed.” Constants: schwimmschachHall.

CSE (c) S. Tanimoto, 2008 Predicate Calculus I 23 Relations “Each University of Central Lake Union (UCLU) building must either have an emergency rowboat or be in violation of the Lake Quake code. Any building in violation of the Lake Quake code will be temporarily closed. The annex of Schwimmschach Hall has dinghies but no emergency rowboats. Therefore the annex of Schwimmschach Hall will be temporarily closed.” Binary Relations:

CSE (c) S. Tanimoto, 2008 Predicate Calculus I 24 Relations “Each University of Central Lake Union (UCLU) building must either have an emergency rowboat or be in violation of the Lake Quake code. Any building in violation of the Lake Quake code will be temporarily closed. The annex of Schwimmschach Hall has dinghies but no emergency rowboats. Therefore the annex of Schwimmschach Hall will be temporarily closed.” Binary Relations: has(x, y). x has y. annexOf(x, y). x is an annex of y. We could choose to use a function theAnnexOf(x), but this makes assumptions about the number of annexes of each building, and would need a new domain element “None” for some buildings and for boats, which don’t have annexes.

CSE (c) S. Tanimoto, 2008 Predicate Calculus I 25 Encoding by Statement “Each University of Central Lake Union (UCLU) building must either have an emergency rowboat or be in violation of the Lake Quake code. Any building in violation of the Lake Quake code will be temporarily closed. The annex of Schwimmschach Hall has dinghies but no emergency rowboats. Therefore the annex of Schwimmschach Hall will be temporarily closed.”

CSE (c) S. Tanimoto, 2008 Predicate Calculus I 26 Encoding by Statement “Each University of Central Lake Union (UCLU) building must either have an emergency rowboat or be in violation of the Lake Quake code. Any building in violation of the Lake Quake code will be temporarily closed. The annex of Schwimmschach Hall has dinghies but no emergency rowboats. Therefore the annex of Schwimmschach Hall will be temporarily closed.” (  x) (isBuilding(x)  ((has(x, y)  isRowboat(y)) V inViolation(x))

CSE (c) S. Tanimoto, 2008 Predicate Calculus I 27 Encoding by Statement “Each University of Central Lake Union (UCLU) building must either have an emergency rowboat or be in violation of the Lake Quake code. Any building in violation of the Lake Quake code will be temporarily closed. The annex of Schwimmschach Hall has dinghies but no emergency rowboats. Therefore the annex of Schwimmschach Hall will be temporarily closed.”

CSE (c) S. Tanimoto, 2008 Predicate Calculus I 28 Encoding by Statement “Each University of Central Lake Union (UCLU) building must either have an emergency rowboat or be in violation of the Lake Quake code. Any building in violation of the Lake Quake code will be temporarily closed. The annex of Schwimmschach Hall has dinghies but no emergency rowboats. Therefore the annex of Schwimmschach Hall will be temporarily closed.” (  x) ( inViolation(x)  tempClosed(x))

CSE (c) S. Tanimoto, 2008 Predicate Calculus I 29 Encoding by Statement “Each University of Central Lake Union (UCLU) building must either have an emergency rowboat or be in violation of the Lake Quake code. Any building in violation of the Lake Quake code will be temporarily closed. The annex of Schwimmschach Hall has dinghies but no emergency rowboats. Therefore the annex of Schwimmschach Hall will be temporarily closed.”

CSE (c) S. Tanimoto, 2008 Predicate Calculus I 30 Encoding by Statement “Each University of Central Lake Union (UCLU) building must either have an emergency rowboat or be in violation of the Lake Quake code. Any building in violation of the Lake Quake code will be temporarily closed. The annex of Schwimmschach Hall has dinghies but no emergency rowboats. Therefore the annex of Schwimmschach Hall will be temporarily closed.” (  x) ( annexOf(schwimmschachHall, x)  (  y) (isDinghy(x)  has(x, y))   (  z) (isRowboat(z)  has(x,z)) ) Here, that the annex exists is a presupposition, and we are choosing to represent it explicitly.

CSE (c) S. Tanimoto, 2008 Predicate Calculus I 31 Encoding by Statement “Each University of Central Lake Union (UCLU) building must either have an emergency rowboat or be in violation of the Lake Quake code. Any building in violation of the Lake Quake code will be temporarily closed. The annex of Schwimmschach Hall has dinghies but no emergency rowboats. Therefore the annex of Schwimmschach Hall will be temporarily closed.”

CSE (c) S. Tanimoto, 2008 Predicate Calculus I 32 Encoding by Statement “Each University of Central Lake Union (UCLU) building must either have an emergency rowboat or be in violation of the Lake Quake code. Any building in violation of the Lake Quake code will be temporarily closed. The annex of Schwimmschach Hall has dinghies but no emergency rowboats. Therefore the annex of Schwimmschach Hall will be temporarily closed.” (  x) ( annexOf(schwimmschachHall, x)  tempClosed(x) ) We are re-representing the presupposition, and using the binding in “tempClosed(x).”