1 Knowledge Representation and Reasoning. 2 Knowledge Representation & Reasoning How knowledge about the world can be represented How knowledge about.

Slides:



Advertisements
Similar presentations
Artificial Intelligence
Advertisements

The Foundations: Logic and Proofs
Propositional Logic CMSC 471 Chapter , 7.7 and Chuck Dyer
Knowledge Representation Methods
Knowledge Representation I Suppose I tell you the following... The Duck-Bill Platypus and the Echidna are the only two mammals that lay eggs. Only birds.
Computability and Complexity 9-1 Computability and Complexity Andrei Bulatov Logic Reminder (Cnt’d)
Computability and Complexity 8-1 Computability and Complexity Andrei Bulatov Logic Reminder.
Logic. Propositional Logic Logic as a Knowledge Representation Language A Logic is a formal language, with precisely defined syntax and semantics, which.
First-Order Logic Chapter 8.
Syllabus Every Week: 2 Hourly Exams +Final - as noted on Syllabus
November 5, 2009Introduction to Cognitive Science Lecture 16: Symbolic vs. Connectionist AI 1 Symbolism vs. Connectionism There is another major division.
FIRST-ORDER LOGIC FOL or FOPC
Knoweldge Representation & Reasoning
Let remember from the previous lesson what is Knowledge representation
Predicate Calculus.
Fall 2002CMSC Discrete Structures1 Let’s proceed to… Mathematical Reasoning.
Predicates and Quantifiers
Intro to Discrete Structures
ARTIFICIAL INTELLIGENCE [INTELLIGENT AGENTS PARADIGM] Professor Janis Grundspenkis Riga Technical University Faculty of Computer Science and Information.
First Order Logic Chapter 7. PL is a Weak Representational Language §Propositional Logic (PL) is not a very expressive language because: §Hard to identify.
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.
Chapter 1, Part II: Predicate Logic With Question/Answer Animations.
ARTIFICIAL INTELLIGENCE Lecture 3 Predicate Calculus.
Propositional Logic Dr. Rogelio Dávila Pérez Profesor-Investigador División de Posgrado Universidad Autónoma Guadalajara
First-Order Logic Introduction Syntax and Semantics Using First-Order Logic Summary.
1 Predicate (Relational) Logic 1. Introduction The propositional logic is not powerful enough to express certain types of relationship between propositions.
SSK3003 DISCRETE STRUCTURES
1 Introduction to Computational Linguistics Eleni Miltsakaki AUTH Spring 2006-Lecture 8.
CSE 311 Foundations of Computing I Lecture 7 Logical Inference Autumn 2012 CSE
Hazırlayan DISCRETE COMPUTATIONAL STRUCTURES Propositional Logic PROF. DR. YUSUF OYSAL.
LECTURE LECTURE Propositional Logic Syntax 1 Source: MIT OpenCourseWare.
CS6133 Software Specification and Verification
Artificial Intelligence Chapter 15 The Predicate Calculus Artificial Intelligence Chapter 15 The Predicate Calculus Biointelligence Lab School of Computer.
For Wednesday Read chapter 9, sections 1-3 Homework: –Chapter 7, exercises 8 and 9.
For Friday Read chapter 8 Homework: –Chapter 7, exercises 2 and 10 Program 1, Milestone 2 due.
Chapter 7. Propositional and Predicate Logic Fall 2013 Comp3710 Artificial Intelligence Computing Science Thompson Rivers University.
Dr. Shazzad Hosain Department of EECS North South Universtiy Lecture 04 – Part B Propositional Logic.
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.
PREDICATE CALCULS In Propositional Calculus, each atomic symbol denotes a proposition. But there is no way to access the components of an individual assertion.
First-Order Logic Semantics Reading: Chapter 8, , FOL Syntax and Semantics read: FOL Knowledge Engineering read: FOL.
ARTIFICIAL INTELLIGENCE Lecture 2 Propositional Calculus.
Outline Logic Propositional Logic Well formed formula Truth table
1 CS 2710, ISSP 2610 Chapter 8, Part 1 First Order Predicate Calculus FOPC.
Discrete Mathematical Structures: Theory and Applications 1 Logic: Learning Objectives  Learn about statements (propositions)  Learn how to use logical.
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.
Chapter 1 Logic and proofs
CS.462 Artificial Intelligence SOMCHAI THANGSATHITYANGKUL Lecture 04 : Logic.
March 8, 2016Introduction to Artificial Intelligence Lecture 13: Knowledge Representation & Reasoning II 1Resolution And yet Another Example: Resolving.
Knowledge Representation and Reasoning 2
2. The Logic of Compound Statements Summary
Knowledge Representation and Reasoning
Applied Discrete Mathematics Week 5: Mathematical Reasoning
ARTIFICIAL INTELLIGENCE
CS201: Data Structures and Discrete Mathematics I
CSE 311 Foundations of Computing I
CS201: Data Structures and Discrete Mathematics I
Mathematical Reasoning
Resolution And yet Another Example:
Back to “Serious” Topics…
CSNB234 ARTIFICIAL INTELLIGENCE
Predicates and Quantifiers
Chapter 1: Propositional and First-Order Logic
Propositional Calculus
Propositional Logic CMSC 471 Chapter , 7.7 and Chuck Dyer
CS201: Data Structures and Discrete Mathematics I
Mathematical Reasoning
Predicate Logic: Syntax.
CS201: Data Structures and Discrete Mathematics I
Introduction to Computational Linguistics
Presentation transcript:

1 Knowledge Representation and Reasoning

2 Knowledge Representation & Reasoning How knowledge about the world can be represented How knowledge about the world can be represented What kinds of reasoning can be done with that knowledge. What kinds of reasoning can be done with that knowledge. Two different systems that are commonly used to represent knowledge: Two different systems that are commonly used to represent knowledge: Propositional calculus Propositional calculus Predicate calculus Predicate calculus

3 Propositional Calculus In propositional calculus, features of the world are represented by propositions, features of the world are represented by propositions, relationships between features (constraints) are represented by connectives. relationships between features (constraints) are represented by connectives.Example: LECTURE_BORING  TIME_LATE ! SLEEP

4 Propositional Calculus You see that the language of propositional calculus can be used to represent aspects of the world. When there are a language, as defined by a syntax, a language, as defined by a syntax, inference rules for manipulating sentences in that language, and inference rules for manipulating sentences in that language, and semantics for associating elements of the language with elements of the world, semantics for associating elements of the language with elements of the world, then we have a system called logic.

5 Logic When we have too many states, we want a convenient way of dealing with sets of states.When we have too many states, we want a convenient way of dealing with sets of states. The sentence “It’s raining” stands for all the states of the world in which it is raining.The sentence “It’s raining” stands for all the states of the world in which it is raining. Logic provides a way of manipulating big collections of sets by manipulating short descriptions instead.Logic provides a way of manipulating big collections of sets by manipulating short descriptions instead.

6 What is a logic? A formal language: Syntax – what expressions are legalSyntax – what expressions are legal Semantics – what legal expressions meanSemantics – what legal expressions mean Proof system – a way of manipulating syntactic expressions to get other syntactic expressions (which will tell us something new)Proof system – a way of manipulating syntactic expressions to get other syntactic expressions (which will tell us something new)

7 Propositional Logic Atoms: The atoms T and F and all strings that begin with a capital letter, for instance, P, Q, LECTURE_BORING, and so on. Connectives:  “or”  “or”  “and”  “and” ! “implies” or “if-then” ! “implies” or “if-then” $ “equivalence” $ “equivalence”  “not”  “not”

8 Propositional Logic Syntax of well-formed formulas (wffs): Any atom is a wff. Any atom is a wff. If  1 and  2 are wffs, so are If  1 and  2 are wffs, so are  1   2 (conjunction)  1   2 (disjunction)  1 !  2 (implication)  1 $  2 (double implication)  1 $  2 (double implication)  1 (negation) There are no other wffs. There are no other wffs.

9 Propositional Logic Atoms and negated atoms are called literals. Atoms and negated atoms are called literals. In  1 !  2,  1 is called the antecedent, and  2 is called the consequent of the implication. In  1 !  2,  1 is called the antecedent, and  2 is called the consequent of the implication. Examples of wffs (sentences): Examples of wffs (sentences): (P  Q) !  P P !  P P  P ! P (P ! Q) ! (  Q !  P)  P  P

10 Precedence : Æ Ç ! $ highest lowest A Ç B Æ C A Ç (B Æ C) A Æ B ! C Ç D (A Æ B) ! (C Ç D) A ! B Ç C $ D (A ! (B Ç C)) $ D Precedence rules enable “shorthand” form of sentences, but formally only the fully parenthesized form is legal. Syntactically ambiguous forms allowed in shorthand only when semantically equivalent: A Æ B Æ C is equivalent to (A Æ B) Æ C and A Æ (B Æ C)

11 Rules of Inference We use rules of inference to generate new wffs from existing ones. One important rule is called modus ponens or the law of detachment. It is based on the tautology (P  (P ! Q)) ! Q. We write it in the following way: P P ! Q _____  Q The two hypotheses P and P ! Q are written in a column, and the conclusion below a bar, where  means “therefore”.

12 Rules of Inference P______  P  Q Addition P  Q P  Q_____  P Simplification P Q______  P  Q Conjunction  Q  Q P ! Q P ! Q_____   P Modus tollens P ! Q P ! Q Q ! R Q ! R_______  P ! R Hypothetical syllogism P  Q P  Q  P  P_____  Q Disjunctive syllogism

13 Predicate Calculus Proposition’s are simple but weak, so it is a better idea to use predicates instead of propositions. This leads us to predicate calculus. Predicate calculus has symbols called object constants, object constants, relation constants, and relation constants, and function constants function constants These symbols will be used to refer to objects in the world and to propositions about the world.

14 Syntax of First-Order Logic in BNF Sentence  AtomicSentence | Sentence Connective Sentence | Quantifier Variable,… Sentence |  Sentence | (Sentence) AtomicSentence  Predicate(Term,…) | Term= Term Term  Function(Term,…) | Constant | Variable

15 Syntax of First-Order Logic in BNF     | $ Connective   |  |  |  | $ Quantifier   |  Constant  A | X 1 | John | … Variable  a | v | x | … Predicate  Before | HasColor | Raining | … Function  MotherOf | LegOf | …

16Components Object constants: Strings of alphanumeric characters beginning with either a capital letter or a numeral. Examples: XY, George, 154, H1B Function constants: Strings of alphanumeric characters beginning with a lowercase letter and (sometimes) superscripted by their “arity”: Examples: fatherOf 1, distanceBetween 2

17Components Relation constants: Strings of alphanumeric characters beginning with a capital letter and (sometimes) superscripted by their “arity”: Examples: BeatsUp 2, Tired 1 Other symbols: Propositional connectives , , !, $, and , delimiters (, ), [, ].

18 Terms An object constant is a term.An object constant is a term. A function constant of arity n, followed by n terms in parentheses and separated by commas, is a term.A function constant of arity n, followed by n terms in parentheses and separated by commas, is a term. Examples: fatherOf(George), times(3, minus(5, 2))

19WffsAtoms: A relation constant of arity n followed by n terms in parentheses and separated by commas is an atom. An atom is a wff.A relation constant of arity n followed by n terms in parentheses and separated by commas is an atom. An atom is a wff. Examples: Tired(John), OlderThan(Hans, Peter)Examples: Tired(John), OlderThan(Hans, Peter) Propositional wffs: Any expression formed out of predicate-calculus wffs in the same way that the propositional calculus forms wffs out of other wffs is a propositional wff.Any expression formed out of predicate-calculus wffs in the same way that the propositional calculus forms wffs out of other wffs is a propositional wff. Example: OlderThan(John, Peter)  OlderThan(Peter, Jennifer)Example: OlderThan(John, Peter)  OlderThan(Peter, Jennifer)

20Quantification Introducing the universal quantifier  and the existential quantifier  facilitates the translation of world knowledge into predicate calculus. Examples: Paul hates all professors who fail him.  x(Professor(x)  Fails(x, Paul) ! Hates(Paul, x)) There is at least one intelligent Sharif professor.  x(SharifProf(x)  Intelligent(x))

21 Rules of Inference  x P(x)  x P(x)__________  P(c) if c  U Universal instantiation P(c) for an arbitrary c  U ___________________   x P(x) Universal generalization  x P(x)  x P(x)______________________  P(c) for some element c  U Existential instantiation P(c) for some element c  U ____________________   x P(x) Existential generalization

22 Quantifiers Properties of quantifiers: –  x  y is the same as  y  x –  x  y is the same as  y  x – note:  x  y can be written as  x  y likewise with  Example? –  x  y Likes(x,y) is active voice: Everyone likes everyone. Everyone likes everyone. –  y  x Likes(x,y) is passive voice: Everyone is liked by everyone. Everyone is liked by everyone.

23 Quantifiers Properties of quantifiers: –  x  y is not the same as  y  x –  x  y is not the same as  y  x Example? –  x  y Likes(x,y) is active voice: Everyone likes someone. Everyone likes someone. –  y  x Likes(x,y) is passive voice: Someone is liked by everyone. Someone is liked by everyone.

24 Quantifiers Properties of quantifiers: –  x P(x) is the same as  x  P(x) –  x P(x) is the same as  x  P(x) Example? –  x Likes(x,IceCream) Everyone likes ice cream. Everyone likes ice cream. –  x  Likes(x,IceCream) No one doesn't like ice cream. It's a double negative! It's a double negative!

25 Quantifiers Properties of quantifiers: –  x P(x) when negated is  x  P(x) –  x P(x) when negated is  x  P(x) Example? –  x Likes(x,IceCream) Everyone likes ice cream. Everyone likes ice cream. –  x  Likes(x,IceCream) Someone doesn't like ice cream. Someone doesn't like ice cream. –This is from the application of de Morgan's law to the fully instantiated sentence.

26 Basics A free variable is a variable that isn't bound by a quantifier. –  y Likes(x,y) x is free, y is bound x is free, y is bound A well-formed formula is a sentence where all variables are quantified.

27 Summary Term: Constant, variable, or Function(term 1, …, term n ) denotes an object in the world Ground Term has no variables Atom: Predicate(term 1, …, term n ), term 1 = term 2 is smallest expression assigned a truth value Sentence: atom, quantified sentence with variables or complex sentence using connectives is assigned a truth value Well-Formed Formula (wff): sentence where all variables are quantified

28 An example of E.I. 1.  x(Bottle(x,T1)  Upturned(x, T2)) 2.  x  y(Upturned(x, y)  Empty(x, y)) 3.  x(Full(x, T1) & Empty(x, T2)  Wet(Floor)) 4.  x (Bottle(x, T1) & Full(x, T1)) T1T2 b1b2b3 b1b2b3

29 An example of E.I. 5. Bottle(b1, T1) & Full(b1, T1))- EI assumption 6.Bottle(b1, T1)- &, 5 7.Full(b1, T1)- &, 5 8.Upturned (b1, T2)- , 1, - , 6 9.Empty(b1, T2)- , 2, - , 7 10.Full(b1, T1) & Empty (b1, T2)+ &, 7, 9 11.Wet(Floor) - , 3, - , 10 Wet(Floor)- EI conclusion