Knowledge Representation

Slides:



Advertisements
Similar presentations
Artificial Intelligence
Advertisements

1 Knowledge Representation Introduction KR and Logic.
Biointelligence Lab School of Computer Sci. & Eng.
Inference Rules Universal Instantiation Existential Generalization
1 A formula in predicate logic An atom is a formula. If F is a formula then (~F) is a formula. If F and G are Formulae then (F /\ G), (F \/ G), (F → G),
Knowledge & Reasoning Logical Reasoning: to have a computer automatically perform deduction or prove theorems Knowledge Representations: modern ways of.
Standard Logical Equivalences
Resolution.
Inference and Reasoning. Basic Idea Given a set of statements, does a new statement logically follow from this. For example If an animal has wings and.
Logic Use mathematical deduction to derive new knowledge.
Logic.
F22H1 Logic and Proof Week 7 Clausal Form and Resolution.
Using Predicate Logic Chapter 5.
Knowledge Representation Methods
Outline Recap Knowledge Representation I Textbook: Chapters 6, 7, 9 and 10.
CSE (c) S. Tanimoto, 2008 Propositional Logic
Knowledge & Reasoning Logical Reasoning: to have a computer automatically perform deduction or prove theorems Knowledge Representations: modern ways of.
I NTRO TO L OGIC Dr Shlomo Hershkop March
UBI517 Expert Systems 1 Lecture 2 Knowledge Representation.
 Predicate: A sentence that contains a finite number of variables and becomes a statement when values are substituted for the variables. ◦ Domain: the.
UNIVERSITI TENAGA NASIONAL 1 CSNB234 ARTIFICIAL INTELLIGENCE Chapter 3 Propositional Logic & Predicate Logic Chapter 3 Propositional Logic & Predicate.
Pattern-directed inference systems
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.
ARTIFICIAL INTELLIGENCE [INTELLIGENT AGENTS PARADIGM] Professor Janis Grundspenkis Riga Technical University Faculty of Computer Science and Information.
Chapter 1, Part II: Predicate Logic With Question/Answer Animations.
Automated Reasoning Early AI explored how to automated several reasoning tasks – these were solved by what we might call weak problem solving methods as.
CPSC 386 Artificial Intelligence Ellen Walker Hiram College
CS6133 Software Specification and Verification
Chapter 2 Logic 2.1 Statements 2.2 The Negation of a Statement 2.3 The Disjunction and Conjunction of Statements 2.4 The Implication 2.5 More on Implications.
Propositional Logic Predicate Logic
Chapter 7. Propositional and Predicate Logic Fall 2013 Comp3710 Artificial Intelligence Computing Science Thompson Rivers University.
CIT 856 – Artificial Intelligence
First-Order Logic Semantics Reading: Chapter 8, , FOL Syntax and Semantics read: FOL Knowledge Engineering read: FOL.
Foundations of Discrete Mathematics Chapter 1 By Dr. Dalia M. Gil, Ph.D.
Logical Agents. Outline Knowledge-based agents Logic in general - models and entailment Propositional (Boolean) logic Equivalence, validity, satisfiability.
Chapter 7. Propositional and Predicate Logic
2. The Logic of Compound Statements Summary
Introduction to Logic for Artificial Intelligence Lecture 2
Advanced Algorithms Analysis and Design
CSE15 Discrete Mathematics 01/23/17
Knowledge Representation and Reasoning
A I (Artificial Intelligence)
The Propositional Calculus
Proposition & Predicates
Knowledge Representation
Predicate Logic Lecture 7.
The Foundations: Logic and Proofs
Propositional Logic and Methods of Inference
Knowledge & Reasoning Logical Reasoning: to have a computer automatically perform deduction or prove theorems Knowledge Representations: modern ways of.
CS201: Data Structures and Discrete Mathematics I
CSE 311 Foundations of Computing I
CS201: Data Structures and Discrete Mathematics I
Logic Use mathematical deduction to derive new knowledge.
First Order Logic Rosen Lecture 3: Sept 11, 12.
Back to “Serious” Topics…
Negations of quantifiers
Chapter 7. Propositional and Predicate Logic
Knowledge Representation I (Propositional Logic)
CSNB234 ARTIFICIAL INTELLIGENCE
Predicates and Quantifiers
CSNB234 ARTIFICIAL INTELLIGENCE
This Lecture Substitution model
Foundations of Discrete Mathematics
Propositional Calculus
Propositional Logic CMSC 471 Chapter , 7.7 and Chuck Dyer
CS201: Data Structures and Discrete Mathematics I
Logical and Rule-Based Reasoning Part I
CS201: Data Structures and Discrete Mathematics I
Habib Ullah qamar Mscs(se)
Presentation transcript:

Knowledge Representation Lecture 2 Knowledge Representation UBI517 Expert Systems

Knowledge representation Epistemology or theory of knowledge is the branch of philosophy that studies the nature, methods, limitations, and validity of knowledge and belief. In other words, epistemology primarily addresses the following questions: "What is knowledge?", "How is knowledge acquired?", and "What do people know?" Wikipedia UBI 517 Expert Systems

Knowledge representation Epistemology Addresses The structure used to describe the elements of knowledge. The interpretive process required to use the described knowledge. UBI 517 Expert Systems

Representation Criteria Transparency Explicitness Naturalness Efficiency Adequacy Modularity Transparency- The extent to which we can easily identify stored knowledge. How much the system is understandable both to the system developer and the system user. Expert systems often separate domain specific knowledge from general problem solving knowledge to improve transparency.   . Explicitness- The extent to which knowledge is directly represented. . Naturalness- The extent to which knowledge is represented in its native form. . Efficiency- The ease of access to specific knowledge during execution. . Adequacy-The extent to which a given structure can be used to represent all knowledge required for the system. . Modularity- The extent to which knowledge fragments can be stored independently from one another. UBI 517 Expert Systems

Knowledge Representation Schemes Mypoulos and Lavesque (1984) classification:   1) Logical representation schemes First order predicate logic for knowledge representation (scheme) Prolog for implementing (media) 2) Procedural representation schemes Production systems UBI 517 Expert Systems

Knowledge Representation Schemes 3) Network representation schemes Capture knowledge as a graph in which the nodes represent the objects or concepts in the problem domain and the arcs represent the relations or associations between them. Semantic networks Conceptual graphs   4) Structured representation schemes Each node is considered as a complex data structure consisting of named slots with attached values Frame-based systems UBI 517 Expert Systems

Formal Logic Logic provides Formal Logic A representation of knowledge & Automation of the inferencing process Formal Logic Propositional Logic Predicate Logic UBI 517 Expert Systems

Propositional Logic One of the oldest & simplest type of formal logic Formal indicates logic is concerned with form of logical statements as opposed to meaning UBI 517 Expert Systems

Propositional Logic Propositional symbols denote propositions or statements about the world that may be either true or false. Examples It is raining. raining   It is sunny. sunny If it is raining then it is not sunny. raining Þ Ø sunny UBI 517 Expert Systems

Propositional Logic The truth table for the implication connective is shown below. UBI 517 Expert Systems

Propositional Logic For propositional expressions P, Q, and R: Ø(ØP) = P (PÚQ) = (ØPÞQ) De Morgan's Law: Ø(PÚQ) = (ØPÙØQ) De Morgan's Law: Ø(PÙQ) = (ØPÚØQ) distributive law: PÚ(QÙR) = (PÚQ)Ù(PÚR) distributive law: PÙ(QÚR) = (PÙQ)Ú(PÙR) commutative law: (PÙQ) = (QÙP) commutative law: (PÚQ) = (QÚP) associative law: PÙ(QÙR) = (PÙQ) ÙR associative law: PÚ(QÚR) = (PÚQ)ÚR contrapositive law: (PÞQ) = (ØQÞØP) UBI 517 Expert Systems

Propositional Logic PREMISE: All X are Y Doesn’t matter if X is PREMISE: Z is a X Conclusion: Z is a Y Separating form from meaning is what gives logic its power as a tool Propositional logic is a symbolic logic for manipulating propositions or logical variables Propositions are classified as either T or F. KBS course is brilliant - (definitely T) Fish is good to eat - ( uncertain truth as depends on person) Doesn’t matter if X is apples, planes or Ships. Only the form is important. UBI 517 Expert Systems

Propositional Logic Propositional logic connectives Conjunction AND He is tall - (variable involved so can’t assign value. Also tall is hard concept to define. Can’t be done in pred. Calculus). Proposition logic: assign a truth value to statements Propositional logic provides a mechanism for assigning a truth value to compound proposition based on value of individual propositions and connective involved Propositional logic connectives Conjunction AND Disjunction OR Negation NOT A’ Material implication If-Then --> Material equivalence Equals UBI 517 Expert Systems

Propositional Logic Prop Logic Solution - Predicate Logic can only deal with complete sentences that is, it can not examine the internal structure of a statement. too simple for complex domains no support for inferencing doesn’t handle fuzzy concepts Solution - Predicate Logic UBI 517 Expert Systems

First order predicate logic Predicate logic was developed in order to analyze more general cases. Propositional logic is a subset of predicate logic. Concerned with internal structure of sentences Quantifiers - all, some, no - make sentence more exact. Wider scope of expression. UBI 517 Expert Systems

First order predicate logic an alphabet a formal language axioms inference rules   UBI 517 Expert Systems

an alphabet predicates represent the relations within the domain: man(tom) variables - Dog, Color functions - father(CHILD), plus (2, 3) constants - rover(a_dog), blue(a_color) connectives - and, or, not, is equivalent to.. quantifiers - "X, $ X : "x [ PERSON(X) ® NEED-AIR(X)] delimiters UBI 517 Expert Systems

Language Evaluation is done by the use of truth tables. A legally constructed formula in the language is called a well-formed formula (wff)   Evaluation is done by the use of truth tables.   UBI 517 Expert Systems

Language Knowledge engineering When Using Formal Logic Develop an understanding of the knowledge. Formulate the knowledge as English statements. Break the statements into their component parts. Choose symbols to represent the elements and relations in each component. Build wffs by using the above symbols that represent the statement. Predicate relation is derived by its name and its arity. UBI 517 Expert Systems

Language Example: "Rover is a black dog“ "You will gain weight unless you exercise.“ “If the student’s average grade is greater than 90%, then the student will get an A in the course.” black(rover) dog(rover) "X [¬exercise(X) ® gain_weight(X) ] "X, " Name [(student(Name)  avrg_grade(Name, X)  ge(X, 90) ® final_grade(Name, “A”) ] UBI 517 Expert Systems

Inference Process Inference in formal logic is the process of generating new wffs from existing wffs through the application of rules of inference. UBI 517 Expert Systems

Inference Process Conclusion: Many English sentences are ambiguous. There is often a choice of ways of representing the knowledge. Even in very simple situations a set of sentences is unlikely to contain all the information necessary to reason about the topic at hand. UBI 517 Expert Systems

Inference Process Logical Inferences Modus ponens and modus tolens provide the foundation for making references. Modus ponens: ((p ® q) Ù p) ® q If someone is snorkeling then he is wet "x snorkeling(X) ® wet(X) If we are given that alex is snorkeling snorkeling (alex) we can infer wet(alex) UBI 517 Expert Systems

Inference Process Logical Inferences Modus tolens: ((p ® q) Ù q) ®  p If someone is snorkeling then he is wet "x snorkeling(X) ® wet(X) If we are given that alex is not wet  wet(alex) we can infer  snorkeling(alex) UBI 517 Expert Systems

Inference Process There are three reasoning methods that can be applied to a set of premises. Deduction Abduction Induction UBI 517 Expert Systems

"x, "y, "z larger(x, y) Ù larger(y, z) ® larger(x, z) Inference Process Deduction is reasoning from known (premises) to unknown (logical conclusions). "x, "y, "z larger(x, y) Ù larger(y, z) ® larger(x, z) If our list of axioms contain the axioms larger(house, car) larger(car, cat) Through deductive reasoning the wff larger(house, cat) Can be derived and added to our list of axioms UBI 517 Expert Systems

Inference Process In Abduction we begin with a conclusion and procede to derive conditions that would make the conclusion valid. In other words we try to find an explanation for the conclusion It does not guarantee that a true conclusion results. Therefore it s called unsound rule of inference. If given A ® B and B is true Abduction allows us to say A is possibly true. Reasoning under uncertainty. UBI 517 Expert Systems

Inference Process Induction Inductive reasoning forms the basis of scientific discovery. If given p(a) is true p(b) is true …….. Then we conclude "x, p(x) is true If we observe alex over a period of time and note that whenever he is wet, it turns out that he has gone snorkeling. We might induce that "x, wet(x) ® snorkeling(x) Like abduction, induction is also an unsound inference method. UBI 517 Expert Systems

Inference Process Monotonic vs non-monotonic reasoning Deductive reasoning is a monotonic reasoning that produce as arguments that preserve truth. Axioms are not allowed to change, since once a fact is known to be true, it is always true and can never be modified or retracted. Most real life problems are non-monotonic quarter(fourth) leading(bucks) "Team [leading(Team) Ù quarter(fourth)] ® strategy(Team, conservative) We can deduce strategy(bucks, conservative) What if the state changes to leading(dolphins) UBI 517 Expert Systems

Inference Process RESOLUTION attempts to show that the negation of the statement produces a contradiction with the known statements. winter V summer ~winter V cold  deduce  summer V cold In the above example if it is winter the first statement is true if not the second statement is true. From these two we can deduce the third statement to be true UBI 517 Expert Systems

Inference Process Conjuctive normal form(Davis, 1960) The steps to convert to conjuctive normal form:   1. Eliminate ® by using the fact that a ® b is equivalent to ~a V b 2. Reduce the scope of ~ ~(A V B) = ~A Ù ~B ~(A Ù B) = ~A V ~B DeMorgan's law ~"x P(x) = $x ~P(x) ~$x P(x) = "x ~P(x) UBI 517 Expert Systems

Inference Process 3. Standardize variables so that each quantifier binds a unique variable. "x P(x) V "x Q(x) would be converted to "x P(x) V "y Q(y) 4. Move all quantifiers to the left of the formula without changing their relative order. "x "y P(x) V Q(y)   UBI 517 Expert Systems

Inference Process 5. Eliminate existential quantifiers. A formula that contains an existentially quantified variable asserts that there is a value that can be substituted for the variable that makes the formula true.   $y President(y) can be transformed into President(S1) UBI 517 Expert Systems

Inference Process 5. If existential quantifiers occur within the scope of a universal quantifier then the value that satisfies the predicate may depend on the values of the universally quantified variables.   "x $y fatherof(y, x) can be transformed into "x fatherof(S2(x), x) These generated functions are called Skolem functions. UBI 517 Expert Systems

Inference Process 6. Drop the prefix.   7. Convert the matrix into conjunction of disjuncts. 8. Call each conjunct a separate clause. UBI 517 Expert Systems

Inference Process The Unification Algorithm:   The object of the unification procedure is to discover at least one substitution that causes two literals to match. UBI 517 Expert Systems

Inference Process Example: 1. Marcus was a man. man(marcus) 2. Marcus was a Pompeian. pompeian(marcus)  3. All Pompeians were Romans. "x pompeian(X) ® roman(X)  4. Caesar is a ruler. ruler(caesar) UBI 517 Expert Systems

Inference Process 5. All Romans were either loyal to Caesar or hated him. "x roman(X) ® loyalto(X, casear) v hate(X, casear)  6. Everyone is loyal to someone. "X $ Y loyalto(X, Y)  7. People only try to assassinate rulers they are not loyal to. "X "Y person(X) Ù ruler(Y) Ù tryassassinate(X,Y) ® ~loyalto(X, Y)  8. Marcus tried to assassinate Caesar. tryassassinate(marcus, caesar) UBI 517 Expert Systems

Inference Process Proof by resolution:  Given the axioms in clause form: 1. man(Marcus) 2. Pompeian(Marcus) 3. ~Pompeian(x1) V Roman(x1) 4. ruler(Caesar) 5. ~Roman(x2) V loyalto(x2, Caesar) V hate(x2, Caesar) 6. loyalto(x3, f1(x3)) 7. ~person(x4) V ~ruler(y1) V ~tryassassinate(x4, y1) V ~loyalto(x4, y1) 8. tryassassinate(Marcus, Caesar) UBI 517 Expert Systems

Inference Process Prove: hate(Marcus, Caesar) UBI 517 Expert Systems

Inference Process Prove: loyalto(Marcus, Caesar) UBI 517 Expert Systems

Inference Process Prove: loyalto(Marcus, Caesar) - Continue Suppose our knowledge base contained the two additional statements 9. persecute(x, y) ® hate(y, x) ~persecute(x5, y2) V hate(y2, x5) 10. hate(x, y) ® persecute(y, x) ~hate(x6, y3) V persecute(y3, x6) To detect that there is no contradiction we must discover that the only resolvents that can be generated have been generated before. UBI 517 Expert Systems

Prolog Prolog is the implementation language for predicate logic. Prolog is declarative Three main features are: Facts Rules Backtracking If something is not explicitly stated, Prolog assumes that it is false. Prolog is non-monotonic where it deviates from pure predicate logic. UBI 517 Expert Systems

Example child_of(alex, nicole). child_of(alina, nicole). child_of(nicholas, leah). child_of(philip, leah). child_of(melanie, cathy). male(alex). male(philip). male(nicholas). female(alina). female(leah). female(nicole). female(angela). sisters(nicole, leah). sisters(X, Z):- child_of(X, Y), child_of(Z, Y), female(X), female(Z) UBI 517 Expert Systems

Disadvantages of Predicate Logic as a Basis for Knowledge-Based System Managing uncertainty availability of only two levels of truth – true or false. certainty factors have been implemented in Prolog to mitigate this. Monotonic versus non-monotonic reasoning. UBI 517 Expert Systems

Exercises: Consider the following sentences: John likes all kinds of food. Apples are food. Chicken is food. Anything anyone eats and isn't killed by is food. Bill eats peanuts and is still alive. Sue eats everything Bill eats. a. Translate these sentences into formulas in predicate logic. b. Convert the formulas of part a into clause form. c. Prove that John likes peanuts. d. Use resolution to answer the question, "What food does Sue eat?" UBI 517 Expert Systems

Exercises: Consider the following logic statements: "x [panther(X) ® feline(X)] "x [house_cat(X) ® feline(X)] "x [house_cat(X) ® docile(X)] "x [feline(X) ® carnivore(X)] "x [carnivore(X) ® food(X, meat)] "x [horse(X) ® herbivore(X)] "x [herbivore(X) ® food(X, plants)] UBI 517 Expert Systems

Exercises:  a)Using modus ponens derive all possible relations from the following facts. panther(sam) house_cat(rubble) lion(leo) b)Using abduction and the following statement what could kitty be? food(kitty, meat) c)Convert all of the logic statements into clauses d) Attempt to prove the following statements using resolution: house_cat(rebel)  food(rebel, meat) horse(wilber)  food(wilber, meat) UBI 517 Expert Systems