Knowledge-Based Systems

Slides:



Advertisements
Similar presentations
Expert System Seyed Hashem Davarpanah
Advertisements

1 Knowledge Representation Introduction KR and Logic.
Heuristic Search techniques
Computer Science CPSC 322 Lecture 25 Top Down Proof Procedure (Ch 5.2.2)
Semantics Static semantics Dynamic semantics attribute grammars
The Assembly Language Level
Knowledge Representation
Intelligent systems Lection 7 Frames, selection of knowledge representation, its combinations.
Intelligent systems Lecture 6 Rules, Semantic nets.
Rule Based Systems Michael J. Watts
Systems Analysis and Design 9th Edition
Chapter 12: Expert Systems Design Examples
Expert System Human expert level performance Limited application area Large component of task specific knowledge Knowledge based system Task specific knowledge.
© C. Kemke Knowledge Representation 1 COMP 4200: Expert Systems Dr. Christel Kemke Department of Computer Science University of Manitoba.
Constraint Logic Programming Ryan Kinworthy. Overview Introduction Logic Programming LP as a constraint programming language Constraint Logic Programming.
CS 330 Programming Languages 09 / 18 / 2007 Instructor: Michael Eckmann.
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.
© C. Kemke1Reasoning - Introduction COMP 4200: Expert Systems Dr. Christel Kemke Department of Computer Science University of Manitoba.
Marakas: Decision Support Systems, 2nd Edition © 2003, Prentice-Hall Chapter Chapter 1: Introduction to Decision Support Systems Decision Support.
© 2002 Franz J. Kurfess Knowledge Representation 1 CPE/CSC 481: Knowledge-Based Systems Dr. Franz J. Kurfess Computer Science Department Cal Poly.
Creating Architectural Descriptions. Outline Standardizing architectural descriptions: The IEEE has published, “Recommended Practice for Architectural.
EXPERT SYSTEMS Part I.
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.
© 2002 Franz J. Kurfess Knowledge Representation 1 CPE/CSC 481: Knowledge-Based Systems Dr. Franz J. Kurfess Computer Science Department Cal Poly.
CS 330 Programming Languages 09 / 16 / 2008 Instructor: Michael Eckmann.
Objects Objects are at the heart of the Object Oriented Paradigm What is an object?
Knowledge representation methods جلسه سوم. KR is AI bottleneck The most important ingredient in any expert system is knowledge. The power of expert systems.
ARTIFICIAL INTELLIGENCE [INTELLIGENT AGENTS PARADIGM] Professor Janis Grundspenkis Riga Technical University Faculty of Computer Science and Information.
GENERAL CONCEPTS OF OOPS INTRODUCTION With rapidly changing world and highly competitive and versatile nature of industry, the operations are becoming.
Notes for Chapter 12 Logic Programming The AI War Basic Concepts of Logic Programming Prolog Review questions.
CSC 8520 Fall, Paula Matuszek Slides taken in part from:
Artificial Intelligence 4. Knowledge Representation Course V231 Department of Computing Imperial College, London © Simon Colton.
Knowledge Representation 1 Expert Systems Dr. Samy Abu Nasser.
Of 33 lecture 10: ontology – evolution. of 33 ece 720, winter ‘122 ontology evolution introduction - ontologies enable knowledge to be made explicit and.
Knowledge Representation CPTR 314. The need of a Good Representation  The representation that is used to represent a problem is very important  The.
 Architecture and Description Of Module Architecture and Description Of Module  KNOWLEDGE BASE KNOWLEDGE BASE  PRODUCTION RULES PRODUCTION RULES 
Dimitrios Skoutas Alkis Simitsis
Pattern-directed inference systems
Logical Agents Logic Propositional Logic Summary
ISBN Chapter 3 Describing Semantics -Attribute Grammars -Dynamic Semantics.
TextBook Concepts of Programming Languages, Robert W. Sebesta, (10th edition), Addison-Wesley Publishing Company CSCI18 - Concepts of Programming languages.
Major objective of this course is: Design and analysis of modern algorithms Different variants Accuracy Efficiency Comparing efficiencies Motivation thinking.
Semantic web course – Computer Engineering Department – Sharif Univ. of Technology – Fall Knowledge Representation Semantic Web - Fall 2005 Computer.
Object-Oriented Modeling: Static Models. Object-Oriented Modeling Model the system as interacting objects Model the system as interacting objects Match.
Chapter 3 Part II Describing Syntax and Semantics.
Knowledge Representation
Some Thoughts to Consider 8 How difficult is it to get a group of people, or a group of companies, or a group of nations to agree on a particular ontology?
© Copyright 2008 STI INNSBRUCK Intelligent Systems Propositional Logic.
Knowledge Representation Fall 2013 COMP3710 Artificial Intelligence Computing Science Thompson Rivers University.
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,
Forward and Backward Chaining
Expert System Seyed Hashem Davarpanah University of Science and Culture.
Lecture 5 Frames. Associative networks, rules or logic do not provide the ability to group facts into associated clusters or to associate relevant procedural.
Some Thoughts to Consider 5 Take a look at some of the sophisticated toys being offered in stores, in catalogs, or in Sunday newspaper ads. Which ones.
Artificial Intelligence Knowledge Representation.
Knowledge Engineering. Sources of Knowledge - Books - Journals - Manuals - Reports - Films - Databases - Pictures - Audio and Video Tapes - Flow Diagram.
16 April 2011 Alan, Edison, etc, Saturday.. Knowledge, Planning and Robotics 1.Knowledge 2.Types of knowledge 3.Representation of knowledge 4.Planning.
Artificial Intelligence Logical Agents Chapter 7.
Logical Agents. Outline Knowledge-based agents Logic in general - models and entailment Propositional (Boolean) logic Equivalence, validity, satisfiability.
Knowledge Representation. A knowledge base can be organised in several different configurations to facilitate fast inferencing Knowledge Representation.
Knowledge Representation Techniques
Knowledge Representation
Artificial Intelligence (CS 370D)
Knowledge Representation
Objective of This Course
KNOWLEDGE REPRESENTATION
Knowledge Representation
Semantic Nets and Frames
Presentation transcript:

Knowledge-Based Systems 1

Course Overview Introduction Knowledge Representation Semantic Nets, Frames, Logic Reasoning and Inference Predicate Logic, Inference Methods, Resolution Reasoning with Uncertainty Probability, Bayesian Decision Making Pattern Matching Variables, Functions, Expressions, Constraints Expert System Design ES Life Cycle Expert System Implementation Salience, Rete Algorithm Expert System Examples Conclusions and Outlook 2

Overview Knowledge Representation Motivation Objectives Chapter Introduction Review of relevant concepts Overview new topics Terminology Knowledge and its Meaning Epistemology Types of Knowledge Knowledge Pyramid Knowledge Representation Methods Production Rules Semantic Nets Schemata and Frames Logic Semantic Web and KR Ontologies OWL RDF Important Concepts and Terms Chapter Summary 3

Motivation KBS are useless without the ability to represent knowledge different knowledge representation schemes may be appropriate depending on tasks and circumstances knowledge representation schemes and reasoning methods must be coordinated 4

Objectives know the basic principles and concepts for knowledge representation knowledge - information - data meaning be familiar with the most frequently used knowledge representation methods logic, rules, semantic nets, schemata differences between methods, advantages, disadvantages, performance, typical scenarios understand the relationship between knowledge representation and reasoning syntax, semantics derivation, entailment apply knowledge representation methods usage of the methods for simple problems 5

Knowledge Engineering The process of building an expert system is called knowledge Engineering Iterative and incremental

Knowledge Engineering Phases

Phase 1: Assessment Phase Problem practicality Expert System Creation Justification Determine General Project Idea Determine needed resources

Phase 2: knowledge acquisition Knowledge Acquisition: study of knowledge , acquisition, organization Knowledge Acquisition  Knowledge base creation Identification of knowledge resource (human or nonhuman) Design methods for knowledge extraction from resources according to resource type Extract knowledge from resources according to designed methods Knowledge integration

Phase 3: Design Representation techniques Save knowledge in knowledge base Knowledge Processing and inferences Techniques Prototype

Test Feedback to previous Phases Objective: System general structure and extracted knowledge validation and verification Use Expert guidance

Knowledge and its Meaning Epistemology(علم مطالعه دانش) این علم با ماهیت، ساختار و اصول دانش سر و کار دارد. Types of Knowledge Knowledge Pyramid 12

برخی مقوله های موجود در معرفت شناختی دانش فلسفی دانش پیشین دانش پسین ارسطو پلاتو کانت لاک میل

Types of Knowledge a priori knowledge (theoretical knowledge) comes before knowledge perceived through senses considered to be universally true a posteriori knowledge (empirical knowledge) knowledge verifiable through the senses may not always be reliable procedural knowledge knowing how to do something declarative knowledge knowing that something is true or false 14

Types of Knowledge Tacit knowledge (unconscious knowledge) knowledge not easily expressed by language دانستن نحوه حرکت دست؟ => انقباض و انبساط چند ماهیچه و تاندون => ماهیچه ها و تاندون ها چگونه منقبض و منبسط می شوند؟ Neural Network Certain Knowledge Uncertain knowledge

Knowledge in Expert Systems Conventional Programming Knowledge-Based Systems Algorithms + Data Structures = Programs Knowledge + Inference = Expert System 16

Knowledge Pyramid Meta-Knowledge Knowledge Information Data Noise 17

Knowledge Representation Methods Suppose Access to Problem knowledge Problem Knowledge –> L Knowledge Intelligible for machines L’ Convert L to L’ Inefficiency Of Conventional Language Need New language 18

Knowledge Representation Methods: L’ Properties Support knowledge representation (procedural/ declarative, certain/ uncertain) Easy

Knowledge Representation Methods: L’ Production Rules Semantic Nets Scripts and Frames Logic Conceptual graphs Object-Attribute-Value Triple Comparison based on superficial independence , simplicity and intelligibly

Production Rules frequently used to formulate the knowledge in expert systems Knowledge of Problem is formulated in the form of rules: C1, c2, c3, …  X Each rule identify the relationship between a sequence of observations and a result 21

Production Rules Observations: Example: Attribute - value pair Result of a rule Procedure Example: Weather- cold, cloudy-yes  Rainy Holiday- yes, Rainy-yes stay at home

Production Rules Rules have Superficial independence but can be dependent semantically Superficial independence Easy management

Production Rules 1. If the ball’s color is red Then I like the ball 2. If I like the ball Then I will buy the ball Question: Ball’s Color? Answer: Red

Example 1. If the ball’s color is red Then I like the ball 2. If I like the ball Then I will buy the ball

Rule’s Type Relationship Rules IF the battery is dead Then the car will not start Recommendation Rules IF the car will not start THEN take a cab Directive Rules IF the car will not start AND the fuel system is ok THEN check out the electrical system

Rule’s Type Strategy Rules IF the car will not start THEN first check out the fuel system THEN check out the electrical system Heuristic Rules IF the car will not start AND the car is a 1957 Ford THEN check the float

Rule’s Type Pattern Matching Rules IF ?X is Employee AND ?X Age>65 THEN ?X can retire Meta Rules IF the car will not start AND the electrical System is operating normally THEN use rules concerning the fuel system

Productions One formal notation for defining productions is the BNF( Backus-Naur form) This notation is a Metalanguage for defining the syntax of a language Syntax define form Semantic refer to meaning A metalanguage is language for describing languages

Productions Many Type of languages: Natural languages, logic languages, mathematical languages, and computer languages BNF notation for a simple language rule that a sentence consists of a noun and a verb followed by punctuation is the following production rule: <> , ::= are symbols of metalanguage ::= means is defined as and is BNF equivalent of  Term within <> are nonterminal symbols Terminal cannot be replaced by anything else and so is a constant

Productions The following rules complete the nonterminals by specifying their possible terminals Bar means or in the metalanguage

Productions String (set of terminals) Valid Sentence( string can be derived from the start symbol) Grammar: Complete set of production rules that define a language‍‍

Productions Parse Tree or Derivation Tree: Graphic representation of a sentence decomposed into all the terminals and nonterminals used to derive the sentence

Productions Compiler create a parse tree when it tries to determine whether statements in a program Conform to the valid syntax of a language

Production System Knowledge base (Production Rules) Working Memory Interpreter (Inference Engine) Three steps called the recognize-act cycle: 1. Match the variables of the antecedent of a rule in knowledge base with WM 2. If more than one rule is available decide which rule to fire (a strategy for conflict resolution) 3. Add new item to WM or delete old item from WM and go to step 1

Conflict Resolution strategies Refractoriness Same rule could not be fired more than once when instantiated with the same set of data Solution: discard or delete the instantiations from WM which have been used once  avoid loop Recency Most recent element of the working memory be used up for instantiating one of the rules Specificity Rule with more number of antecedent clauses be fired than rules handling fewer antecedent clauses

Conflict Resolution strategies Specificity Rule with more number of antecedent clauses be fired than rules handling fewer antecedent clauses Example PR1: Bird(X) Fly(X) PR2: Bird(X),Not emu(X) Fly(x) Suppose: WM contains the Data Bird(X) and Not emu. Both rule are firable. However the second rule should be fired.

Conflict Resolution strategies MYCYN use another approach for resolving conflicts via metarules Metarules can be either domain-specific or domain-free Domain-Specific metarule: applicable for identifying the rule to fire only in a specific domains Domain-free rules: very general kind

Conflict Resolution strategies Domain-Specific metarule: If 1) the infection is pelvic abscess 2)and there are rules which mention in their premise entero-bactoriae and 3) there are rules which mention in their premise gram-positive rods Then there exists suggestive evidence (0.4) that the former should be applied before the later

Conflict Resolution strategies Domain-free rule If 1) there are rules which do not mention the current goal in their premise and 2) there are rules which mention the current goal in their premise Then it is definite (1.0) that former should be applied before the later

The conflict resolution with two rules PRi and PRj has been demonstrated in this architecture.

An Illustrative Production System water-jug problem: Given 2 water jugs, 4 liters and 3 liters. Neither has Any measuring marks on it. There is a pump that can be used to fill the jugs. How can you get exactly 2 liters of water into 4-liter jugs?

An Illustrative Production System U denote content of 4L jug V denote content of 3L jug Content of two jug will be represented by (U,V) Start up element in WM is (0,0)

An Illustrative Praoduction System:PR

An Illustrative Production System keep track of the reasoning process  draw a state-space for the problem. leaves generated after firing of the rules, should be stored in WM. first consider all possibilities of the solution (i.e., without resolving the conflict). Later we would fire only one rule even though more than one are fireable.

State Space without conflict resolution

Conflict Resolution Strategy Avoid doubling back, whenever possible. In other words, never attempt to generate old entries. Rete Match Algorithm?

Type of Production Systems two special types of production systems: i) commutative system (جابجایی پذیر) ii) decomposable system(تجزیه پذیر)

Commutative Production System A production system is called commutative if for a given set of rules R and a working memory WM the following conditions are satisfied i) Freedom in orderliness of rule firing: Arbitrary order of firing of the applicable rules selected from set S will not make a difference in the content of WM. In other words, the WM that results due to an application of a sequence of rules from S is invariant under the permutation of the sequence.

Commutative Production System ii) Invariance of the pre-condition of attaining goal: If the pre-condition of a goal is satisfied by WM before firing of a rule, then it should remain satisfiable after firing of the rule. iii) Independence of rules: The firability condition of an yet unfired rule Ri with respect to WM remains unaltered, even after firing of the rule Rj for any j.

Decomposable Production System A production system is called decomposable if the goal G and the working memory can be partitioned into Gi and WMi, such that G = ANDi (Gi ), WM = ∪ { WMi } ∀i rules are applied onto each WMi independently or concurrently to yield Gi. The termination of search occurs when all the goals Gi for all i have been identified.

Forward versus Backward Production Systems Most of the common classical reasoning problems of AI can be solved by any of the following two techniques: i) forward reasoning or forward chaining (Top- Down) ii) backward reasoning backward chaining (Bottom- UP)

Forward versus Backward Production Systems In a forward reasoning problem such as 4-puzzle games or the water-jug problem, where the goal state is known, the problem solver has to identify the states by which the goal can be reached. These class of problems are generally solved by expanding states from the known starting states with the help of a domain-specific knowledge base. The generation of states from their predecessor states may be continued until the goal is reached.

Forward versus Backward Production Systems On the other hand, consider the problem of system diagnosis or driving a car from an unknown place to home. Here, the problems can be easily solved by employing backward reasoning, since the neighboring states of the goal node are known better than the neighboring states of the starting states. For example, in diagnosis problems, the measurement points are known better than the cause of defects. for the driving problem, the roads close to home are known better than the roads close to the unknown starting location of driving. It is thus clear that, whatever be the class of problems, system states from starting state to goal or vice versa are to be identified, which requires expanding one state to one or more states.

Forward versus Backward Production Systems If there exists no knowledge to identify the right offspring state from a given state, then many possible offspring states are generated from a known state. This enhances the search-space for the goal. When the distance (in arc length) between the starting state and goal state is long, determining the intermediate states and the optimal path (minimum arc length path) between the starting and the goal state becomes a complex problem.

Forward versus Backward Production Systems Forward Reasoning ES Rule Base 2 1 3 Forward Inference Engine Response Observations 1

Forward Reasoning: Inference Mechanism 1. Perceive Inputs 2. Interpret Inputs based on observations 3. Apply action in the environment Point  No explicit input problem Use WM for observation management Relation of inference engine and environment by using WM WM is a World model (Inference mechanism0

Forward Reasoning Algorithm Based on WM search KB for rules that their condition are available in WM (loop until find something) 1. If more than one rule are available select one of them (Conflict resolution) 2. Execute (fire) the selected rule (transfer its consequence to WM) 3. Go to step 1 Point: Time between rule selection and execution!!!

Forward Reasoning Algorithm Example: X  A-1, B-2, C-3 Y C - >2 Z Y, D-1 X D-1, M-4 WM: [A-1, B-2, C-3, M-4, D-1]

Forward versus Backward Production Systems Backward Reasoning ES Rule Base 2 1 4 Backward Inference Engine Response Problem Observations 3 3

Inference Mechanism 1. Problem trigger inference engine 2. Looking for observations which are needed for solving the problem 3. Apply action in the environment Point  Identification of the problem (correct problem)

Forward & Backward Comparison Observe the entire environment at any instance of time Observation management (by using working memory) Backward: No need to observe Simple observation management mechanism

Forward versus Backward Production Systems The following example illustrates the principle of forward and backward reasoning with reference to the well-known “farmer’s fox-goat- cabbage problem”.

farmer’s fox-goat-cabbage problem Example : The problem may be stated as follows. A farmer wants to transfer his three belongings, a wolf, a goat and a cabbage, by a boat from the left bank of a river to its right bank. The boat can carry at most two items including the farmer. If unattended, the wolf may eat up the goat and the goat may eat up the cabbage. How should the farmer plan to transfer the items?

farmer’s fox-goat-cabbage problem The illegal states in the problem are (W,G | | F,C) , (G,C | | F,W), (F, W | | G, C) and ( F, C | | W, G) where F, G, | |, W and C denote the farmer, the goat, the river, the wolf and the cabbage respectively.

part of the knowledge base PR 1: (F, G, W, C | | Nil ) → ( W, C | | F, G) PR 2: (W, C | | F, G) → ( F, W, C | | G) PR 3: (F, W, C | | G) → (C | | F, W, G) PR 4: (C | | F, W, G) → ( F, G, C | | W) PR5: (F, G, C | | W) → (G | | F, W, C) PR 6: ( G | | F, W, C) → ( F, G | | W, C) PR 7: ( F, G, | | W, C) → ( Nil | | F,G, W, C) PR 8 ( F, W, C | | G) → ( W | | F, G, C) PR 9: ( W | | F, G, C) → ( F, G, W | | C) PR 10: ( F, G, W | | C) → ( G | | F, W, C) PR 11: ( G | | F, W, C) → ( F, G | | W,C) PR 12: ( F, G | | W, C) →( Nil | | F, G, W, C)

Forward Reasoning Starting state: ( F, G, W, C | | Nil) Goal state (Nil | | F, G, W, C) one may expand the state-space, starting with (F,G,W,C | | Nil) by the supplied knowledge base, as follows:

Backward Reasoning The backward reasoning scheme can also be invoked for the problem. The reasoning starts with the goal and identifies a rule whose right-hand side contains the goal. It then generates the left side of the rule in a backward manner. The resulting antecedents of the rules are called sub- goals. The sub-goals are again searched among the consequent part of the rules and on a successful match the antecedent parts of the rule are generated as the new sub-goals. The process is thus continued until the starting node is obtained.

A caution about backward reasoning Backward reasoning1 in many circumstances does not support the logical semantics of problem solving. It may even infer wrong conclusions, when a goal or sub-goal (any intermediate state leading to the goal ) has multiple causes for occurrence, and by backward reasoning we miss the right cause and select a wrong cause as its predecessor in the state-space graph.

Example Example 3.4: Consider the following knowledge base, the starting state and the goal state for a hypothetical problem. The “,” in the left-hand side of the production rules PR 1 through PR 4 denotes joint occurrence of them. PR 1: p, q → s PR 2: s, t → u PR 3: p, q, r → w PR 4: w → v PR 5 : v, t → u Starting state: p and q Goal state: u. Other facts: t.

The state-space graph for the hypothetical problem indicates that the goal can be correctly inferred by forward reasoning. However, backward reasoning may infer a wrong conclusion: p and q and r, if PR 5, PR 4 and PR 3 are used in order starting with the goal. Note that r is an extraneous premise, derived by backward reasoning. But in practice the goal is caused due to p, q and t only. Hence, backward reasoning may sometimes yield wrong inferences.

Bi-directional Reasoning Instead of employing either forward or backward reasoning, both of them may be used together in automated problem solving. This is required especially in situations when expanding from either direction leads to a large state-space.

Bi-directional Reasoning

Advantages of Production Rules expressiveness can relevant aspects of the domain knowledge be stated through rules? computational efficiency easy to understand? can humans interpret the rules easy to generate? how difficult is it for humans to construct rules that reflect the domain knowledge 76

Advantages of Production Rules straightforward implementation in computers possible 77

Problems with Production Rules simple implementations are very inefficient some types of knowledge are not easily expressed in such rules large sets of rules become difficult to understand and maintain 78

Semantic Network Much human information is organized in terms of concepts that are linked to each other. Nouns are organized in terms of kind and part relations. E.g. a spaniel is a kind of dog which is a kind of animal. E.g. a claw is part of a foot which is part of a leg which is part of a dog. Verbs are organized in terms of ways of doing, e.g. digging is one way of removing.

Semantic Nets graphical representation for propositional information originally developed by M. R. Quillian as a model for human memory Knowledge Representation using graph composed of nodes and edges nodes represent objects, concepts, or situations labels indicate the name nodes can be instances (individual objects) or classes (generic nodes) links represent relationships the label indicates the type of the relationship without relationships, knowledge is an unrelated collection of facts 80

Types of Relationships relationships can be arbitrarily defined by the knowledge engineer allows great flexibility for reasoning, the inference mechanism must know how relationships can be used to generate new knowledge inference methods may have to be specified for every relationship frequently used relationships IS-A relates an instance (individual node) to a class (generic node) 86

Objects and Attributes AKO (a-kind-of) relates one class (subclass) to another class (superclass) attributes provide more detailed information on nodes in a semantic network often expressed as properties combination of attribute and value attributes can be expressed as relationships e.g. has-attribute 87

Semantic Nets Points: Bird has wings Move with fly canary is-a bird direction is important Graph has three attributes: Has, Is-A, Travel

Semantic Networks Semantic Networks can extend by Same Concepts Specialize Generalize

Semantic Networks

Inheritance Is an important attribute in Semantic Networks Means that Concept or attribute inherit from a node Represent by Is-A Example: Bird has all attributes of animals Inheritance decrease knowledge base, prevent repetition

Semantix Net Example Abraracourcix Astérix is-boss-of is-boss- of Cétautomatix is-a is-a is-friend-of buys-from is-a Obélix Gaul fights-with is-a is-a AKO Dog Panoramix takes-care- of is-a Human lives- with is-a sells-to barks-at Idéfix Ordralfabetix [http://www.asterix.tm.fr] 93

Semantix Net Example

Problems Semantic Nets expressiveness no internal structure of nodes relationships between multiple nodes no easy way to represent heuristic information best suited for binary relationships efficiency may result in large sets of nodes and links usability lack of standards for link types naming of nodes classes, instances نبودن استاندارد برای نامگذاری روابط. هیچ تعریف مشخصی از اسامی روابط وجود ندارد افزایش انفجارآمیز ترکیبات مختلف گره ها که باید جستجو شوند از نظر هیوریستیکی نامناسبند. زیرا روشی برای ورود اطلاعات هیوریستیکی به شبکه ندارد از جنبه منطقی نامناسبند. نمی توانند دانش را به روش منطقی تعریف کنند 110

Semantic network Superficial Knowledge Structure Unsuitable Declarative Knowledge Procedural Knowledge Superficial Knowledge Structure

Semantic Network Superficial Knowledge Structure Knowledge structured in the form of relationship and semantic network nodes Deep Knowledge Structure causal relationships between a percept or action and its outcome Explain why events occurred

Semantic Networks Medicine Expert System First rule Superficial Knowledge First rule IF a person has a fever then take an asprin Biochemical Bases of human body? Why asprin decreases fever If a person has a pink monkey then take a refrigerator

Semantic Networks Superficial aspect of the knowledge of expert system  depends on combination of sentences not their meanings You can replace every two words with X,Y in the Following Rule: If a person has a x then take a y X and Y aren’t variables but identify any Two Words

Semantic Networks Medicos have causal knowledge Various careers and have many experiences If a method doesn’t work Medico can reason and replace method with another method Knowledge Of real environments often can’t represent by semantic networks We need more complicated Structures

Semantic Networks Knowledge Structure and Data Structure Instead of data an ordered set of knowledge considered

There are other kinds of links between concepts representing other kinds of links, e.g. STUDENT is linked to COURSES because students TAKE courses. Exercise: draw a semantic network for UNIVERSITY, including part, kind, and other relations

Object-Attribute-Value Semantic Net One problem: No standard definition of link names IS-A (IS-A and AKO) IS-A and Instance-of ART Expert system: IS-A (AKO) and Instance- of

Object-Attribute-Value Another common link is HAS-A HAS-A( class to subclass opposite AKO) IS-A relate a value to an attribute whereas a HAS-A relates an object to an attribute

Object-Attribute-Value Three items of object-attribute-value( OAV) occur frequently  build simple semantic net using them The semantic net for such as system consists of nodes for objects, attributes and values connected by HAS-A and IS-A links

Schemata suitable for the representation of more complex knowledge causal relationships between a percept or action and its outcome “deeper” knowledge than semantic networks nodes can have an internal structure for humans often tacit knowledge related to the notion of records in computer science 122

Concept Schema abstraction that captures general/typical properties of objects has the most important properties that one usually associates with an object of that type may be dependent on task, context, background and capabilities of the user, … similar to stereotypes makes reasoning simpler by concentrating on the essential aspects may still require relationship-specific inference methods 123

Schema Schemata Has internal structures for nodes unlike semantic networks (labels says every thing) Semantic networks  data structures that search is based on the data saved in the nodes Schemata is same as a data structure that nodes contains records 124

Schema Examples the most frequently used instances of schemata are frames [Minsky 1975] scripts [Schank 1977] frames consist of a group of slots and fillers to define a stereotypical objects scripts are time-ordered sequences of frames

فریم یک ویژگی بسیار مهم در شبکه های معنا وراثت است. وراثت : به ارث بردن مفهوم یا خاصیتی از یک گره (IS- A) وراثت باعث کاهش حجم پایگاه دانش می شود. تکرار نشدن مفاهیم. یافتن پاسخ در شبکه های معنا ==> جستجو در گراف مشکل اصلی : استاندارد نبودن روش بازنمایی است که ممکن است سلیقه ای عمل شود.

فریم نمونه تکمیل شده شبکه های معنا نمودار کلاس در UML است. روش شبکه های معنا یک روش توصیفی است ==> هرچه وجود دارد توصیف می کند ==> زبان هایی مانند lisp به خوبی می توانند شبکه های معنا را کد نمایند. اضافه شدن procedure به شبکه های معنا ==> فریم

فریم فریم ها: توصیفی و رویه ای

فریم دانش حل مسئله بوسیله یک مجموعه متناهی از عناصر به نام قاب تشکیل می شود. هر قاب متناظر است با یک مفهوم، یک رویداد یا یک شیء مفهوم مانند میز، صندلی، انسان => اسم عام رویداد مانند: خوردن، رفتن، نشستن => فعل شیء: انسان 1 ، خوردن غذای x => اسم خاص

فریم در حل مسائل تنها تعریف فیزیکی ( دانش توصیفی--> ویژگی که بر محیط تاثیر نمی گذارد) کافی نیست بلکه باید رفتار (دانش رویه ای --> ویژگی که بر محیط تاثیر می گذارد) را نیز مشخص کنیم. هر قاب ترکیبی است از دانش توصیفی و رویه ای به اینصورت که ویژگی های رفتاری و ظاهری مفهوم، رویداد و یا شیء بیان می شود. قاب ها می توانند با یکدیگر در رابطه توارث قرار گیرند.

فریم دو دسته قاب داریم: مفهوم شیء با فرض طول توارث 1 قاب های پایگاه دانش را می توان به صورت زیر در نظر گرفت: قاب های اصلی (concept ) قاب های مصداق (instance )

فریم قاب های اصلی شامل: نام یک دنباله متناهی از ویژگی ها ( که به ازای هر ویژگی یک نام، یک نوع، یک مجموعه از ارزش ها، ارزش پیش فرض بیان می شود)‏ نام و نوع اجباری است. براساس ویژگی های توصیفی می توان ویژگی های رفتاری تعریف نمود.

فریم مفهوم: کتاب قاب : کتاب نویسنده: string(30) تاریخ نشر: تاریخ تعداد صفحات: عددی

فریم قاب مصداق شامل: نام نوعی از ....(قاب اصلی)‏ به ازای هز ویژگی در قاب اصلی یک محل برای ارزش آن ویژگی در این مصداق در نظر گرفته می شود.(slot )

فریم کتاب 01 کتاب X 11/11/2004 250 استنتاج روی قاب های مصداق انجام می شود (در قالب دستیابی به slot ها ( ذخیره و بازیابی))

فریم رفتار منسوب به ویژگی در قالب if-needed و if- changed صورت می پذیرد.

ساختار کلی قاب

Frame represents related knowledge about a subject provides default values for most slots frames are organized hierarchically allows the use of inheritance knowledge is usually organized according to cause and effect relationships slots can contain all kinds of items rules, facts, images, video, comments, debugging info, questions, hypotheses, other frames slots can also have procedural attachments procedures that are invoked in specific situations involving a particular slot on creation, modification, removal of the slot value 138

Simple Frame Example Slot Name Filler name Astérix height small weight low profession warrior armor helmet intelligence very high marital status presumed single 139

Overview of Frame Structure two basic elements: slots and facets (fillers, values, etc.); typically have parent and offspring slots used to establish a property inheritance hierarchy (e.g., specialization-of) descriptive slots contain declarative information or data (static knowledge) procedural attachments contain functions which can direct the reasoning process (dynamic knowledge) (e.g., "activate a certain rule if a value exceeds a given level") data-driven, event-driven ( bottom-up reasoning) expectation-drive or top-down reasoning pointers to related frames/scripts - can be used to transfer control to a more appropriate frame [Rogers 1999] 140

Slots each slot contains one or more facets facets may take the following forms: values default used if there is not other value present range what kind of information can appear in the slot if-added procedural attachment which specifies an action to be taken when a value in the slot is added or modified (data-driven, event-driven or bottom-up reasoning) if-needed procedural attachment which triggers a procedure which goes out to get information which the slot doesn't have (expectation-driven; top-down reasoning) other may contain frames, rules, semantic networks, or other types of knowledge [Rogers 1999] 141

Usage of Frames filling slots in frames can inherit the value directly can get a default value these two are relatively inexpensive can derive information through the attached procedures (or methods) that also take advantage of current context (slot-specific heuristics) filling in slots also confirms that frame or script is appropriate for this particular situation [Rogers 1999] 142

Restaurant Frame Example generic template for restaurants different types default values script for a typical sequence of activities at a restaurant [Rogers 1999] 144

Generic RESTAURANT Frame Specialization-of: Business-Establishment Types: range: (Cafeteria, Fast-Food, Seat-Yourself, Wait-To-Be-Seated) default: Seat-Yourself if-needed: IF plastic-orange-counter THEN Fast-Food, IF stack-of-trays THEN Cafeteria, IF wait-for-waitress-sign or reservations-made THEN Wait-To-Be-Seated, OTHERWISE Seat-Yourself. Location: range: an ADDRESS if-needed: (Look at the MENU) Name: Food-Style: range: (Burgers, Chinese, American, Seafood, French) default: American if-added: (Update Alternatives of Restaurant) Times-of-Operation: range: a Time-of-Day default: open evenings except Mondays Payment-Form: range: (Cash, CreditCard, Check, Washing-Dishes-Script) Event-Sequence: default: Eat-at-Restaurant Script Alternatives: range: all restaurants with same Foodstyle if-needed: (Find all Restaurants with the same Foodstyle) [Rogers 1999] 145

Restaurant Script EAT-AT-RESTAURANT Script Props: (Restaurant, Money, Food, Menu, Tables, Chairs) Roles: (Hungry-Persons, Wait-Persons, Chef-Persons) Point-of-View: Hungry-Persons Time-of-Occurrence: (Times-of-Operation of Restaurant) Place-of-Occurrence: (Location of Restaurant) Event-Sequence: first: Enter-Restaurant Script then: if (Wait-To-Be-Seated-Sign or Reservations) then Get-Maitre-d's-Attention Script then: Please-Be-Seated Script then: Order-Food-Script then: Eat-Food-Script unless (Long-Wait) when Exit-Restaurant-Angry Script then: if (Food-Quality was better than Palatable) then Compliments-To-The-Chef Script then: Pay-For-It-Script finally: Leave-Restaurant Script [Rogers 1999] 146

Frame Advantages fairly intuitive for many applications very flexible similar to human knowledge organization suitable for causal knowledge easier to understand than logic or rules very flexible 147

Frame Problems it is tempting to use frames as definitions of concepts not appropriate because there may be valid instances of a concept that do not fit the stereotype exceptions can be used to overcome this can get very messy inheritance not all properties of a class stereotype should be propagated to subclasses alteration of slots can have unintended consequences in subclasses 148

Logic here: emphasis on knowledge representation purposes logic and reasoning is discussed in the next chapter 149

Representation, Reasoning and Logic two parts to knowledge representation language: syntax describes the possible configurations that can constitute sentences semantics determines the facts in the world to which the sentences refer tells us what the agent believes [Rogers 1999] 150

Reasoning process of constructing new configurations (sentences) from old ones proper reasoning ensures that the new configurations represent facts that actually follow from the facts that the old configurations represent this relationship is called entailment and can be expressed as KB |= alpha knowledge base KB entails the sentence alpha [Rogers 1999] 151

Inference Methods an inference procedure can do one of two things: given a knowledge base KB, it can derive new sentences  that are (supposedly) entailed by KB KB |-  ==> KB |=  given a knowledge base KB and another sentence alpha, it can report whether or not alpha is entailed by KB KB   ==> KB |=  an inference procedure that generates only entailed sentences is called sound or truth-preserving the record of operation of a sound inference procedure is called a proof an inference procedure is complete if it can find a proof for any sentence that is entailed [Rogers 1999] 152

KR Languages and Programming Languages how is a knowledge representation language different from a programming language (e.g. Java, C++)? programming languages can be used to express facts and states what about "there is a pit in [2,2] or [3,1] (but we don't know for sure)" or "there is a wumpus in some square" programming languages are not expressive enough for situations with incomplete information we only know some possibilities which exist [Rogers 1999] 153

KR Languages and Natural Language how is a knowledge representation language different from natural language e.g. English, Spanish, German, … natural languages are expressive, but have evolved to meet the needs of communication, rather than representation the meaning of a sentence depends on the sentence itself and on the context in which the sentence was spoken e.g. “Look!” sharing of knowledge is done without explicit representation of the knowledge itself ambiguous (e.g. small dogs and cats) [Rogers 1999] 154

Good Knowledge Representation Languages combines the best of natural and formal languages: expressive concise unambiguous independent of context what you say today will still be interpretable tomorrow efficient the knowledge can be represented in a format that is suitable for computers practical inference procedures exist for the chosen format effective there is an inference procedure which can act on it to make new sentences [Rogers 1999] 155

Example: Representation Methods [Guinness 1995] 156

Ontologies principles purpose graphical representation examples definition of terms lexicon, glossary relationships between terms taxonomy, thesaurus purpose establishing a common vocabulary for a domain graphical representation UML, topic maps, examples IEEE SUO, SUMO, Cyc, WordNet 157

Terminology ontology lexicon thesaurus taxonomy provides semantics for concepts words are used as descriptors for concepts lexicon provides semantics for all words in a language by defining words through descriptions of their meanings thesaurus establishes relationships between words synonyms, homonyms, antonyms, etc. often combined with a taxonomy taxonomy hierarchical arrangement of concepts often used as a “backbone” for an ontology 158

What is the Semantic Web? Based on the World Wide Web Characterized by resources, not text and images Meant for software agents, not human viewers Defined by structured documents that reference each other, forming potentially very large networks Used to simulate knowledge in computer systems Semantic Web documents can describe just about anything humans can communicate about 159

Ontologies and the Semantic Web Ontologies are large vocabularies Defined within Semantic Web documents (OWL) Define languages for other documents (RDF) Resources can be instances of ontology classes Upper Ontologies define basic, abstract concepts Lower Ontologies define domain-specific concepts Meta-ontologies define ontologies themselves 160

Ontology Terms precision expressiveness descriptors for concepts a term identifies exactly one concept expressiveness the representation language allows the formulation of very flexible statements descriptors for concepts ideally, there should be a one-to-one mapping between a term and the associated concept (and vice versa): high precision, and high expressiveness this is not the case for natural languages “parasitic interpretation” of terms often implies meaning that is not necessarily specified in the ontology 161

IEEE Standard Upper Ontology project to develop a standard for ontology specification and registration based on contributions of three SUO candidate projects IFF OpenCyc/CycL SUMO Standard Upper Ontology Working Group (SUO WG), Cumulative Resolutions, 2003, http://suo.ieee.org/SUO/resolutions.html 162

OpenCyc derived from the development of Cyc a very large-scale knowledge based system Cycorp, The Syntax of CycL, 2002, http://www.cyc.com/cycdoc/ref/cycl- syntax.html 163

SUMO stands for “Suggested Upper Merged Ontology” Niles, Ian, and Adam Pease, Towards a Standard Upper Ontology, 2001 Standard Upper Ontology Working Group (SUO WG), Cumulative Resolutions, 2003, http://suo.ieee.org/SUO/resolutions.html 164

WordNet online lexical reference system design is inspired by current psycholinguistic theories of human lexical memory English nouns, verbs, adjectives and adverbs organized into synonym sets, each representing one underlying lexical concept related efforts for other languages 165

Lojban artificial, logical, human language derived from a language called Loglan one-to-one correspondence between concepts and words high precision high expressiveness audio-visually isomorphic nature only one way to write a spoken sentence only one way to read a written sentence Logical Language Group, Official Baseline Statement, 2005 http://www.lojban.org/llg/baseline.html 166

What is Lojban? A constructed/artificial language Developed from Loglan Dr. James Cooke Brown Introduced between 1955-1960 Maintained by The Logical Language Group Also known as la lojbangirz. Branched Lojban off from Loglan in 1987 [Brandon Wirick, 2005] 167

Main Features of Lojban Usable by Humans and Computers Culturally Neutral Based on Logic Unambiguous but Flexible Phonetic Spelling Easy to Learn Large Vocabulary No Exceptions Fosters Clear Thought Variety of Uses Demonstrated with Prose and Poetry [Brandon Wirick, 2005] 168

Lojban at a Glance Example sentence in English: “Wild dogs bite.” Translation into Lojban: “loi cicyge'u cu batci” cilce (cic) - x1 is wild/untamed gerku (ger, ge'u) - x1 is a dog/canine of species/breed x2 batci (bat) - x1 bites/pinches x2 on/at specific locus x3 with x4 cilce gerku → (cic) (ge'u) → cicyge'u [Brandon Wirick, 2005] 169

How Would Lojban and the Semantic Web Work Together? Currently, most upper ontologies use English Not really English, but arbitrary class names Classes’ meanings cannot be directly inferred from their names, nor vice-versa Translating English prose into Semantic Web documents would be difficult Class choices depend on context within prose English prose is highly idiomatic Lojban does not have these problems [Brandon Wirick, 2005] 170

English v. Lojban [Brandon Wirick, 2005] 171

OWL to the Rescue XML-based. RDF on steroids. Designed for inferencing. Closer to the domain. Don’t need a PhD to understand it. Information sharing. RDF-compatible because it is RDF. Growing number of published OWL ontologies. URIs make it easy to merge equivalent nodes. Different levels OWL lite OWL DL (description logics) OWL full (predicate logic) [Frank Vasquez, 2005] 172

Description Logic Classes Properties Individuals Things, categories, concepts. Inheritance hierarchies via subclasses. Properties Relationships, predicates, statements. Can have subproperties. Individuals Instances of a class. Real subjects and objects of a predicate. [Frank Vasquez, 2005] 173

Visualizing the Data Model Venn Diagrams and Semantic Networks. Images from University of Manchester [Frank Vasquez, 2005] 174

RDF Ontologies Dublin Core FOAF RDF vCard RDF Calendar SIMILE Location SIMILE Job SIMILE Apartment [Frank Vasquez, 2005] 175

Fixing Modeling Conflicts 1. mapAL = Match(MA, ML) [Frank Vasquez, 2005] 176

Post-Test 177

Evaluation Criteria 178

Important Concepts and Terms attribute common-sense knowledge concept data derivation entailment epistemology expert system (ES) expert system shell facet frame graph If-Then rules inference inference mechanism information knowledge knowledge base knowledge-based system knowledge representation link logic meta-knowledge node noise object production rules reasoning relationship rule schema script semantic net slot 179

Summary Knowledge Representation knowledge representation is very important for knowledge-based system popular knowledge representation schemes are rules, semantic nets, schemata (frames, scripts), logic the selected knowledge representation scheme should have appropriate inference methods to allow reasoning a balance must be found between effective representation, efficiency, understandability 180

183