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.

Slides:



Advertisements
Similar presentations
Artificial Intelligence
Advertisements

1 Knowledge Representation Introduction KR and Logic.
Computer Science CPSC 322 Lecture 25 Top Down Proof Procedure (Ch 5.2.2)
Artificial Intelligence
We have seen that we can use Generalized Modus Ponens (GMP) combined with search to see if a fact is entailed from a Knowledge Base. Unfortunately, there.
Logic Use mathematical deduction to derive new knowledge.
Propositional Logic CMSC 471 Chapter , 7.7 and Chuck Dyer
Propositional Logic Reading: C , C Logic: Outline Propositional Logic Inference in Propositional Logic First-order logic.
Logic CPSC 386 Artificial Intelligence Ellen Walker Hiram College.
Logic.
Outline Recap Knowledge Representation I Textbook: Chapters 6, 7, 9 and 10.
Logic in general Logics are formal languages for representing information such that conclusions can be drawn Syntax defines the sentences in the language.
Logic. Propositional Logic Logic as a Knowledge Representation Language A Logic is a formal language, with precisely defined syntax and semantics, which.
CS 561, Sessions Knowledge and reasoning – second part Knowledge representation Logic and representation Propositional (Boolean) logic Normal forms.
CS 460, Sessions Knowledge and reasoning – second part Knowledge representation Logic and representation Propositional (Boolean) logic Normal forms.
CSCI 5582 Fall 2006 CSCI 5582 Artificial Intelligence Lecture 9 Jim Martin.
Logical Agents Chapter 7. Why Do We Need Logic? Problem-solving agents were very inflexible: hard code every possible state. Search is almost always exponential.
Knowledge Representation & Reasoning (Part 1) Propositional Logic chapter 6 Dr Souham Meshoul CAP492.
Logical Agents Chapter 7. Why Do We Need Logic? Problem-solving agents were very inflexible: hard code every possible state. Search is almost always exponential.
Knowledge Representation I (Propositional Logic) CSE 473.
Knowledge in intelligent systems So far, we’ve used relatively specialized, naïve agents. How can we build agents that incorporate knowledge and a memory?
Knoweldge Representation & Reasoning
Let remember from the previous lesson what is Knowledge representation
Logical Agents Chapter 7 Feb 26, Knowledge and Reasoning Knowledge of action outcome enables problem solving –a reflex agent can only find way from.
Agents that Reason Logically Logical agents have knowledge base, from which they draw conclusions TELL: provide new facts to agent ASK: decide on appropriate.
Logical and Rule-Based Reasoning Part I. Logical Models and Reasoning Big Question: Do people think logically?
Inference is a process of building a proof of a sentence, or put it differently inference is an implementation of the entailment relation between sentences.
CSE PredLogic 1 Knowledge Representation with Logic: First Order Predicate Calculus Outline –Introduction to First Order Predicate Calculus (FOPC)
CS 4100 Artificial Intelligence Prof. C. Hafner Class Notes Jan 19, 2012.
Declarative vs Procedural Programming  Procedural programming requires that – the programmer tell the computer what to do. That is, how to get the output.
Pattern-directed inference systems
1 Logical Agents CS 171/271 (Chapter 7) Some text and images in these slides were drawn from Russel & Norvig’s published material.
Logical Agents Logic Propositional Logic Summary
1 Knowledge Representation. 2 Definitions Knowledge Base Knowledge Base A set of representations of facts about the world. A set of representations of.
1 CMSC 471 Fall 2002 Class #10/12–Wednesday, October 2 / Wednesday, October 9.
Slide 1 Propositional Definite Clause Logic: Syntax, Semantics and Bottom-up Proofs Jim Little UBC CS 322 – CSP October 20, 2014.
Logical Agents Chapter 7. Knowledge bases Knowledge base (KB): set of sentences in a formal language Inference: deriving new sentences from the KB. E.g.:
1 Logical Agents CS 171/271 (Chapter 7) Some text and images in these slides were drawn from Russel & Norvig’s published material.
Logical Agents Chapter 7. Outline Knowledge-based agents Logic in general Propositional (Boolean) logic Equivalence, validity, satisfiability.
CS6133 Software Specification and Verification
11 Artificial Intelligence CS 165A Thursday, October 25, 2007  Knowledge and reasoning (Ch 7) Propositional logic 1.
Reasoning with Propositional Logic automated processing of a simple knowledge base CD.
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.
ARTIFICIAL INTELLIGENCE Lecture 2 Propositional Calculus.
Logical Agents Chapter 7. Outline Knowledge-based agents Propositional (Boolean) logic Equivalence, validity, satisfiability Inference rules and theorem.
1 UNIT-3 KNOWLEDGE REPRESENTATION. 2 Agents that reason logically(Logical agents) A Knowledge based Agent The Wumpus world environment Representation,
March 3, 2016Introduction to Artificial Intelligence Lecture 12: Knowledge Representation & Reasoning I 1 Back to “Serious” Topics… Knowledge Representation.
Artificial Intelligence Logical Agents Chapter 7.
Logical Agents. Inference : Example 1 How many variables? 3 variables A,B,C How many models? 2 3 = 8 models.
Logical Agents. Outline Knowledge-based agents Logic in general - models and entailment Propositional (Boolean) logic Equivalence, validity, satisfiability.
Chapter 7. Propositional and Predicate Logic
Knowledge Representation and Reasoning
Knowledge and reasoning – second part
ARTIFICIAL INTELLIGENCE
Introduction to Knowledge-bases
Knowledge Representation
EA C461 – Artificial Intelligence Logical Agent
Logical Agents Chapter 7.
Logic Use mathematical deduction to derive new knowledge.
Artificial Intelligence
CS 416 Artificial Intelligence
Knowledge and reasoning – second part
Back to “Serious” Topics…
MAT 3100 Introduction to Proof
Chapter 7. Propositional and Predicate Logic
CSNB234 ARTIFICIAL INTELLIGENCE
Propositional Logic CMSC 471 Chapter , 7.7 and Chuck Dyer
Logical and Rule-Based Reasoning Part I
Logical Agents Prof. Dr. Widodo Budiharto 2018
Presentation transcript:

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 and mammals are warm blooded. “Susan”, my pet Armadillo is warm blooded, and has no feathers. All birds have feathers. …and I ask you, does “Susan” lay eggs?

Knowledge Representation II We would like to build a system, that we could TELL a set of facts. This system we call a Knowledge Base (KB). At some point in the future we would like to be able to ASK the Knowledge Base questions, and receive correct answers. For simplicity we assume that the knowledge is represented as, and the questions are phrased as, true or false questions. For example we can’t ask “what class is susan?” instead we can ask “susan a amphibian?” “susan a bird?” etc

Knowledge Representation III More concretely, if we collect all out facts into a knowledge base KB, and we later want to know if a fact P is true. We will try to show that given the facts in our database, P must be true. We write this as KB |- P Read as KB entails P

What do we need to do? We need to create a language to represent knowledge in our KB. This language should be Expressive. Unambiguous. “I saw her duck” Context independent. Compositional. We need an algorithm to answer the questions we might ASK. The algorithm should be Sound (only true facts are derived). Complete (all true facts can be derived) Efficient ( we call ask a question and get an answer in reasonable time )

What language should we use? Natural language, ie English, Cantonese. Too ambiguous. Programming Language, ie C++ Lisp. Not very expressive. We will use logic! Actually there are many different logics. We will start by considering Propositional Logic. We will find that has some drawbacks so we will consider the more general Predicate Logic. This too, has limitations, so we will consider the more general First-Order Logic. Propositional Logic Predicate Logic First-Order Logic

A logic language consists of semantics and syntax Semantics: What the sentences mean. Syntax: How sentences can be assembled.

Propositional Logic: Syntax I Vocabulary A set of propositional symbols P, Q, R, …. A set of logical connectives , , , ,   (and)  (or)  (not)  (implication)  (equivalence) Parenthesis (for grouping) ( ) Logical constants True, False

Propositional Logic: Syntax II Each symbol P, Q, R etc is a (atomic) sentence Both True and False are (atomic) sentences A sentence wrapped in parentheses is a sentence If  and  are sentences, then so are    conjunction    disjunction  negation    implication    equivalence The above are complex sentences Precedence is , , , , 

Truth Tables

Sample Sentences P (P   Q)  R True (P  Q)  (Q  P) (P  Q) (P  R ) What do the sentences mean? The meaning depends on user defined semantics. If P is defined as “it is hot” and Q is defined as “it is raining”, then P means it is hot P  Q means either is is hot or it is raining (or both)  Qmeans that it is not raining

Suppose we want to prove  (P  Q)  (P   Q) An inference procedure for proposition logic Construct a truth table, if  (P  Q)  (P   Q) is true for all values of P and Q, then we have proved it. For any sentence, no matter how complex, we can always prove or disprove it this way. In other words, truth table construction is complete.

Inference Rules Some patterns of reasoning are so common that instead of creating a truth table each time we see them, we can just establish their truth once, then reuse the pattern in any situation.

Irish  Hot, Irish |- Hot If we know Irish implies hot is true, and know Irish is true, we can infer Hot is true. Read as Irish implies Hot, Irish, Therefore Hot Irish  Blue |- Blue If we know Irish and Blue is true, we can infer that Blue is true. Read as Irish and Blue Therefore Blue Irish, Red |- Irish  Red If we know Irish is true, and we know Red is true, we can infer that Irish and Red is true. Read as Irish, Red Therefore Irish and Red

Irish |- Irish  Green If we know Irish is true, then we know that Irish or Green is true. Read as Irish, Therefore Irish or Green  Irish |- Irish If we know not not Irish is true, we can infer that Irish is true. Read as Not not Irish, Therefore Irish Irish  Red,  Red  Fast|- Irish  Fast If we know Irish or Red is true, and we know not Red or Fast is true, we can infer that Irish or Fast must be true. Read as Irish or Red, not Red or Fast, Therefore Irish or Fast

Suppose my knowledge base consists of the facts S  T   (  P  R)  S T R And I need to prove P is entailed. I can use the rules of inference to do this.. S  T   (  P  R),  S, TAnd-Introduction S  T   (  P  R),  S  T Double Negation Elimination S  T   (  P  R), (S  T) Modus ponens  (  P  R)And-Elimination  PDouble Negation Elimination P So the rules of inference allow us to (sometimes) bypass having to build truth tables.

So far the news is good. We can represent facts in Propositional Logic, and we have a sound and complete procedure for inference. But Propositional Logic has some weaknesses... The size of the truth tables grows exponentially. So we may run out of space and time before we can answer a question. Suppose I want to encode the fact that all men are mammals, I have no choice but to list that fact for each individual man in my knowledge base Pmeans Paul is a mammal Qmeans Quentin is a mammal Rmeans Robert is a mammal Smeans Steve is a mammal Etc etc What we really need is a compact way represent these kinds of facts….