Lahore University of Management Sciences, Lahore, Pakistan Dr. M.M. Awais- Computer Science Department Lecture 5 Knowledge Representation Formal Method.

Slides:



Advertisements
Similar presentations
Artificial Intelligence
Advertisements

1 Knowledge Representation Introduction KR and Logic.
Lahore University of Management Sciences, Lahore, Pakistan Dr. M.M. Awais- Computer Science Department Lecture 2 Development Life Cycle of ES.
Inference Rules Universal Instantiation Existential Generalization
ICE1341 Programming Languages Spring 2005 Lecture #6 Lecture #6 In-Young Ko iko.AT. icu.ac.kr iko.AT. icu.ac.kr Information and Communications University.
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.
Artificial Intelligence Inference in first-order logic Fall 2008 professor: Luigi Ceccaroni.
Methods of Proof Chapter 7, second half.. Proof methods Proof methods divide into (roughly) two kinds: Application of inference rules: Legitimate (sound)
Logic Use mathematical deduction to derive new knowledge.
Reasoning Forward and Backward Chaining Andrew Diniz da Costa
Propositional Logic Reading: C , C Logic: Outline Propositional Logic Inference in Propositional Logic First-order logic.
Logic.
CS 484 – Artificial Intelligence1 Announcements Choose Research Topic by today Project 1 is due Thursday, October 11 Midterm is Thursday, October 18 Book.
Inferences The Reasoning Power of Expert Systems.
Reasoning System.  Reasoning with rules  Forward chaining  Backward chaining  Rule examples  Fuzzy rule systems  Planning.
Rule Based Systems Michael J. Watts
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.
Artificial Intelligence Lecture No. 16
Expert System Human expert level performance Limited application area Large component of task specific knowledge Knowledge based system Task specific knowledge.
1 RBS CS 331/531 Dr M M Awais Production Systems  Symbolic based Rule based system  Based on simple working principle  System consists of:  production.
1 Problem Solving CS 331 Dr M M Awais Representational Methods Formal Methods Propositional Logic Predicate Logic.
1 5.0 Expert Systems Outline 5.1 Introduction 5.2 Rules for Knowledge Representation 5.3 Types of rules 5.4 Rule-based systems 5.5 Reasoning approaches.
1 Lecture 34 Introduction to Knowledge Representation & Expert Systems Overview  Lecture Objective  Introduction to Knowledge Representation  Knowledge.
Lecture 04 Rule Representation
1 Pertemuan 6 RULE-BASED SYSTEMS Matakuliah: H0383/Sistem Berbasis Pengetahuan Tahun: 2005 Versi: 1/0.
1 Chapter 9 Rules and Expert Systems. 2 Chapter 9 Contents (1) l Rules for Knowledge Representation l Rule Based Production Systems l Forward Chaining.
Rules and Expert Systems
© C. Kemke1Reasoning - Introduction COMP 4200: Expert Systems Dr. Christel Kemke Department of Computer Science University of Manitoba.
Production Rules Rule-Based Systems. 2 Production Rules Specify what you should do or what you could conclude in different situations. Specify what you.
Knoweldge Representation & Reasoning
EXPERT SYSTEMS Part I.
Modelling planning problems using PDDL
Logical and Rule-Based Reasoning Part I. Logical Models and Reasoning Big Question: Do people think logically?
Artificial Intelligence CSC 361
Knowledge representation methods جلسه سوم. KR is AI bottleneck The most important ingredient in any expert system is knowledge. The power of expert systems.
Artificial Intelligence
Artificial Intelligence Lecture No. 15 Dr. Asad Ali Safi ​ Assistant Professor, Department of Computer Science, COMSATS Institute of Information Technology.
Notes for Chapter 12 Logic Programming The AI War Basic Concepts of Logic Programming Prolog Review questions.
School of Computer Science and Technology, Tianjin University
Knowledge based Humans use heuristics a great deal in their problem solving. Of course, if the heuristic does fail, it is necessary for the problem solver.
Chapter 9: Rules and Expert Systems Lora Streeter.
 Architecture and Description Of Module Architecture and Description Of Module  KNOWLEDGE BASE KNOWLEDGE BASE  PRODUCTION RULES PRODUCTION RULES 
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
ARTIFICIAL INTELLIGENCE Lecture 3 Predicate Calculus.
ARTIFICIAL INTELLIGENCE [INTELLIGENT AGENTS PARADIGM] Professor Janis Grundspenkis Riga Technical University Faculty of Computer Science and Information.
CS Introduction to AI Tutorial 8 Resolution Tutorial 8 Resolution.
Expert System Note: Some slides and/or pictures are adapted from Lecture slides / Books of Dr Zafar Alvi. Text Book - Aritificial Intelligence Illuminated.
ARTIFICIAL INTELLIGENCE [INTELLIGENT AGENTS PARADIGM] Professor Janis Grundspenkis Riga Technical University Faculty of Computer Science and Information.
1 Logical Agents CS 171/271 (Chapter 7) Some text and images in these slides were drawn from Russel & Norvig’s published material.
Automated Reasoning Early AI explored how to automated several reasoning tasks – these were solved by what we might call weak problem solving methods as.
Automated Reasoning Early AI explored how to automate several reasoning tasks – these were solved by what we might call weak problem solving methods as.
CS 4100 Artificial Intelligence Prof. C. Hafner Class Notes Jan 24, 2012.
CS6133 Software Specification and Verification
1 Knowledge Based Systems (CM0377) Lecture 10 (Last modified 19th March 2001)
Computing & Information Sciences Kansas State University Lecture 12 of 42 CIS 530 / 730 Artificial Intelligence Lecture 12 of 42 William H. Hsu Department.
First-Order Logic Semantics Reading: Chapter 8, , FOL Syntax and Semantics read: FOL Knowledge Engineering read: FOL.
Forward and Backward Chaining
Artificial Intelligence: Applications
EXPERT SYSTEMS BY MEHWISH MANZER (63) MEER SADAF NAEEM (58) DUR-E-MALIKA (55)
Artificial Intelligence Logical Agents Chapter 7.
Logical Agents. Outline Knowledge-based agents Logic in general - models and entailment Propositional (Boolean) logic Equivalence, validity, satisfiability.
CENG 424-Logic for CS Introduction Based on the Lecture Notes of Konstantin Korovin, Valentin Goranko, Russel and Norvig, and Michael Genesereth.
Knowledge Representation Techniques
Chapter 9. Rules and Expert Systems
Knowledge Representation
Knowledge Representation and Inference
Logical and Rule-Based Reasoning Part I
Representations & Reasoning Systems (RRS) (2.2)
Habib Ullah qamar Mscs(se)
Presentation transcript:

Lahore University of Management Sciences, Lahore, Pakistan Dr. M.M. Awais- Computer Science Department Lecture 5 Knowledge Representation Formal Method Non-Formal Method Examples

Lahore University of Management Sciences, Lahore, Pakistan Dr. M.M. Awais- Computer Science Department Knowledge Representation KR encompasses:  The structure used to describe elements of Knowledge  The interpretive process required to use the described knowledge Components:  Factual Knowledge (Facts)  Procedural Knowledge (Rules)

Lahore University of Management Sciences, Lahore, Pakistan Dr. M.M. Awais- Computer Science Department Representation Evaluation  Transparency: Easy identification of knowledge  Explicitness: Direct representation  Naturalness: Represent without transformation  Efficiency: easy access of knowledge  Adequacy: Complete knowledge representation  Modularity: Fragmentations-independent storage

Lahore University of Management Sciences, Lahore, Pakistan Dr. M.M. Awais- Computer Science Department Level of Representation  Low Level Knowledge The fundamental knowledge used to derive further knowledge Example: The law of Gravity (also known as first principle knowledge)  High Level Knowledge The derived knowledge from the first principle knowledge. This uses inferencing methods

Lahore University of Management Sciences, Lahore, Pakistan Dr. M.M. Awais- Computer Science Department Formal Logic  The most widely used formal logic method is FIRST-ORDER PREDICATE LOGIC Components : Alphabets Formal language Axioms Inference Rules

Lahore University of Management Sciences, Lahore, Pakistan Dr. M.M. Awais- Computer Science Department Alphabets-I Predicates, variables, functions,constants, connectives, quantifiers, and delimiters Constants: (all capital letters) BLUEa color SANTROa car CROWa bird Variables: (all lower case letters) dogan element that is a dog, but unspecified coloran unspecified color

Lahore University of Management Sciences, Lahore, Pakistan Dr. M.M. Awais- Computer Science Department Alphabets-II Function: father(ALI)A function that specifies the unique element, that is the father of ALI killer(x)x is a killer Predicate MAN(SHAHID)A predicate which gets TRUTH value equal to 1 (or represented by T) when the interpretation is true. Here Shahid is a man so the predicate is true. BIGGER(ALI,father(BABAR))Ali is bigger than the father of Babar.

Lahore University of Management Sciences, Lahore, Pakistan Dr. M.M. Awais- Computer Science Department Alphabets-III Connectives: ^and vor ~not Implication Quantification Universal quantifiers Existential quantifiers

Lahore University of Management Sciences, Lahore, Pakistan Dr. M.M. Awais- Computer Science Department Examples My house is a blue, two-story, with red shutters on the corners BLUE(MY-HOUSE)^TWO-STORY(MY-HOUSE)^RED- SHUTTERS(MY-HOUSE)^CORNER(MY-HOUSE) Ali bought a scooter or a car BOUGHT(ALI,CAR)vBOUGHT(ALI,SCOOTER) IF fuel, air and spark are present the fuel will combust PRESENT(SPARK)^PRESENT(FUEL)^PRESEN(AIR) COMBUSTION(FUEL)

Lahore University of Management Sciences, Lahore, Pakistan Dr. M.M. Awais- Computer Science Department Examples All people need air Vx[PERSON(x) NEED_AIR(x)] The owner of the car also owns the boat [OWNER(x,CAR)^OWNER(x,BOAT)] Formulate the following expression in the PC: “Ali is a computer science student but not a pilot or a football player”

Lahore University of Management Sciences, Lahore, Pakistan Dr. M.M. Awais- Computer Science Department Examples Restate the sentence in the following way: 1.Ali is a computer science (CS) student 2.Ali is not a pilot 3.Ali is not a football player CS_STUDENT(ALI)^ ~PILOT(ALI)^ ~FOOTBALL_PLAYER(ALI)

Lahore University of Management Sciences, Lahore, Pakistan Dr. M.M. Awais- Computer Science Department Examples Studying expert systems is exciting and applying logic is very fun if you are not going to spend all of your time slaving over the terminal Vx(~SLAVE(x) [ES_ECITING(x)^LOGIC_FUN(x)]) Every voter either favors the amendment or despises it Vx[VOTER(x) [FAVOR(x,AMENDMENT) v DESPISE(x,AMENDMENT)] ^ ~[FAVOR(x,AMENDMENT) v DESPISE(x,AMENDMENT)[)]

Lahore University of Management Sciences, Lahore, Pakistan Dr. M.M. Awais- Computer Science Department Non-formal Methods Rule Based Method A rule based system consists of a set of IF-THEN rules, a set of facts normally representing things that are currently held to be true, and some interpreter controlling the application of the rules, given the facts Control Scheme Database of facts Initial facts Rules IF THEN ADD IF AND THEN ADD -----

Lahore University of Management Sciences, Lahore, Pakistan Dr. M.M. Awais- Computer Science Department Reasoning Methods Forward Chaining Method Data Driven: Starts from the initial facts and adds new conclusions to the facts database and tries to reach the conclusions Backward Chaining Method Goal Driven: Starts from the goal and looks for the premise of the conclusion in the database, followed by redefining the goal and so on.

Lahore University of Management Sciences, Lahore, Pakistan Dr. M.M. Awais- Computer Science Department Forward Chaining Method Algorithm Repeat: 1.Find all the rules which have conditions (IF part) satisfied 2.Select one, using conflict resolution strategies (which rule to be selected first if there more than one satisfy the conditions). 3.Perform actions in conclusions, possibly modifying current working memory (database of facts).

Lahore University of Management Sciences, Lahore, Pakistan Dr. M.M. Awais- Computer Science Department Forward Chaining Method-II

Lahore University of Management Sciences, Lahore, Pakistan Dr. M.M. Awais- Computer Science Department Inference Chain

Lahore University of Management Sciences, Lahore, Pakistan Dr. M.M. Awais- Computer Science Department Forward Chaining Method Facts: F1:alarm_beeps F2:hot Rules: R1: IF hot AND smoky THEN ADD fire R2:IF alarm_beeps THEN ADD smoky R3: IF fire THEN ADD switch_on_sprinklers

Lahore University of Management Sciences, Lahore, Pakistan Dr. M.M. Awais- Computer Science Department Conflict Resolution  Prefer rules that involve facts that have been recently added to the working memory  Prefer rules with more specific facts  Allow user to prioritise the rules

Lahore University of Management Sciences, Lahore, Pakistan Dr. M.M. Awais- Computer Science Department Forward Chaining Method Facts: F1:alarm_beeps F2:hot F3:dry Rules: R1: IF hot AND smoky THEN ADD fire R2:IF alarm_beeps THEN ADD smoky R3: IF fire THEN ADD switch_on_sprinklers R4: IF dry THEN ADD switch_on_humidifiers R5: IF sprinklers_on THEN DELETE dry R6: IF hot THEN ADD summer

Lahore University of Management Sciences, Lahore, Pakistan Dr. M.M. Awais- Computer Science Department Backward Chaining Method Algorithm To prove a goal: 1.If G is in the initial facts it is proven 2.Otherwise, find a rule which can be used to conclude G, and try to prove each of that rule’s pre-conditions. G is then proved true if all the pre-conditions are proved true.

Lahore University of Management Sciences, Lahore, Pakistan Dr. M.M. Awais- Computer Science Department Backward Chaining Method

Lahore University of Management Sciences, Lahore, Pakistan Dr. M.M. Awais- Computer Science Department Backward Chaining Method G: switch on the sprinklers Facts: F1:alarm_beeps F2:hot Rules: R1: IF hot AND smoky THEN ADD fire R2:IF alarm_beeps THEN ADD smoky R3: IF fire THEN ADD switch_on_sprinklers

Lahore University of Management Sciences, Lahore, Pakistan Dr. M.M. Awais- Computer Science Department Backward Chaining Method Let G=G1: switch on the sprinklers Matches conclusion of R4, precondition of R4 have to be satisfied and becomes new goal New Goal G2: fire Matches conclusion of R1, precondition of R1 have to be satisfied and becomes new goal New Goals G3:smoky, G4: hot G3 Matches conclusion of R2, thus new goal is alarm beeps G4 is already in the initial facts so is true New Goal is G5: alarm_beeps, G4: hot Both are included in the initial facts thus the initial Goal G is true

Lahore University of Management Sciences, Lahore, Pakistan Dr. M.M. Awais- Computer Science Department Example Facts: Nil Rules: R1: IF coughing THEN ADD smoky R2: IF wet AND NOT raining THEN ADD burst_pipe R3: IF NOT coughing AND alarm_rings THEN ADD burglar R4: IF smoky AND hot THEN ADD fire Specify the Line of Questioning and implement backward chaining method to prove burglary

Lahore University of Management Sciences, Lahore, Pakistan Dr. M.M. Awais- Computer Science Department Example Interaction between the user and the ES: System: Are you coughing?. User: No. System: Are you getting wet?. User: No. System: Is there an alarm ringing?. User: No.

Lahore University of Management Sciences, Lahore, Pakistan Dr. M.M. Awais- Computer Science Department Example-II Suppose we are trying to develop a safety system for the a chemical plant. If some liquids spills over and if it is flammable the situation is dangerous and the fire department should be called. In order to check that what type of liquid is spilled one should check the smell of the liquid and the pH value of the material. If the smell is like vinegar and the pH is less than 6, the material is definitely acetic acid. Specify the Line of Questioning and implement backward chaining method to prove material being acetic acid and should the fire deaprtment be called or not

Lahore University of Management Sciences, Lahore, Pakistan Dr. M.M. Awais- Computer Science Department Rules R1: If a flammable liquid was spilled, then call the fre department R2: If the pH of the spill is less than 6, then the spill material is an acid R3: If the spill material is an acid, and the spill smells like vinegar, then the spill material is acetic acid Ph less than 6 Smell like vinegar Material acid Acetic Acid