KNOWLEDGE REPRESENTATION

Slides:



Advertisements
Similar presentations
Computational language: week 10 Lexical Knowledge Representation concluded Syntax-based computational language Sentence structure: syntax Context free.
Advertisements

C-LISP. LISP 2 Lisp was invented by John McCarthy in 1958 while he was at the Massachusetts Institute of Technology (MIT).John McCarthyMassachusetts Institute.
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.
Expert Systems Reasonable Reasoning An Ad Hoc approach.
Expert Systems Reasonable Reasoning An Ad Hoc approach.
CSE 3341/655; Part 4 55 A functional program: Collection of functions A function just computes and returns a value No side-effects In fact: No program.
1 Programming Languages and Paradigms Lisp Programming.
CS 355 – PROGRAMMING LANGUAGES Dr. X. Apply-to-all A functional form that takes a single function as a parameter and yields a list of values obtained.
1-1 An Introduction to Scheme March Introduction A mid-1970s dialect of LISP, designed to be a cleaner, more modern, and simpler version than.
1 MYCIN cs538 Spring 2004 Jason Walonoski. 2 Presentation Outline ► History and Overview ► MYCIN Architecture ► Consultation System  Knowledge Representation.
Lisp – Introduction יעל נצר מערכות נבונות סמסטר ב' תשס"ו.
Defining functions in lisp In lisp, all programming is in terms of functions A function is something which –takes some arguments as input –does some computing.
1 Scheme Scheme is a functional language. Scheme is based on lambda calculus. lambda abstraction = function definition In Scheme, a function is defined.
CIS 430 ( Expert System ) Supervised By : Mr. Ashraf Yaseen Student name : Ziad N. Al-A’abed Student # : EXPERT SYSTEM.
Common Lisp! John Paxton Montana State University Summer 2003.
Functional programming: LISP Originally developed for symbolic computing Main motivation: include recursion (see McCarthy biographical excerpt on web site).
ISBN Chapter 15 Functional Programming Languages Mathematical Functions Fundamentals of Functional Programming Languages Introduction to.
ISBN Lecture 01 Preliminaries. Copyright © 2004 Pearson Addison-Wesley. All rights reserved.1-2 Lecture 01 Topics Motivation Programming.
1 Scheme Although Scheme is syntactically a simple language, it supports sophisticated modeling: higher-order functions are a powerful tool in describing.
1 Functional languages (e.g. Scheme, ML) Scheme is a functional language. Scheme is based on lambda calculus. lambda abstraction = function definition.
Functional programming: LISP Originally developed for symbolic computing First interactive, interpreted language Dynamic typing: values have types, variables.
Rahman Lavaee Mashhadi Mohammad Shadravan. Conditional expressions LISP was the first language to contain a conditional expression In Fortran and Pascal.
PPL Syntax & Formal Semantics Lecture Notes: Chapter 2.
Lisp by Namtap Tapchareon Lisp Background  Lisp was developed by John McCarthy in  Lisp is derives from List Processing Language. 
Genetic Programming.
COM362 Knowledge Engineering Classic Case Studies 1 John MacIntyre
Medical Expert Systems Eddie Lai. History  1950s – scientists tried to use computers for “probabilistic reasoning and statistical pattern recognition”
Presented by Mohammad Saniee December 2, 2003
Artificial Intelligence
ISBN Chapter 15 Functional Programming Languages.
School of Computer Science and Technology, Tianjin University
Formal Semantics Chapter Twenty-ThreeModern Programming Languages, 2nd ed.1.
Functional Programming in Scheme and Lisp.
Intro to Computation and AI Dr. Jill Fain Lehman School of Computer Science Lecture 6: December 4, 1997.
ISBN Chapter 15 Functional Programming Languages.
LISP Data Types Functional Programming Academic Year Alessandro Cimatti
Diagnostic Systems (I): Rule-Based Expert Systems and the MYCIN Project.
Clinical Decision Support Systems Dimitar Hristovski, Ph.D. Institute of Biomedical.
1 FP Foundations, Scheme In Text: Chapter Chapter 14: FP Foundations, Scheme Mathematical Functions Def: A mathematical function is a mapping of.
CSE 425: Functional Programming I Programs as Functions Some programs act like mathematical functions –Associate a set of input values from the function’s.
PPL Syntax & Formal Semantics Lecture Notes: Chapter 2.
Ch Ch jcmt CSE 3302 Programming Languages CSE3302 Programming Languages (n-n-n-notes) Summer 2003 Dr. Carter Tiernan.
Artificial Intelligence: Applications
Functional Languages  A function is an “association of a certain object from one set (the range) with each object from another set (the domain)  A function.
Comp 411 Principles of Programming Languages Lecture 3 Parsing
Artificial Intelligence and Lisp Lecture 6 LiU Course TDDC65 Autumn Semester,
Functional Programming
Functional Programming Languages
LISP – (LISt Processing)
Defining Macros in Lisp
Modern Programming Languages Lecture 20 Fakhar Lodhi
A I (Artificial Intelligence)
The following materials are borrowed from Prof. Ken Forbus’ class
Architecture Components
The Physical Symbol Systems Hypothesis
MYCIN  MYCIN was an early backward chaining expert system that used artificial intelligence to identify bacteria causing severe infections, such as bacteremia.
Functional Programming Languages
The Metacircular Evaluator
Rule-Based Expert Systems: Suitable Domains
Decision Theory: Single Stage Decisions
Intelligent Systems and
Introduction to Artificial Intelligence Lecture 15: Expert Systems
6.001 SICP Variations on a Scheme
Defining Macros in Lisp
Functional Programming: Lisp
6.001 SICP Interpretation Parts of an interpreter
Modern Programming Languages Lecture 18 Fakhar Lodhi
Introduction to the Lab
Defining Macros in Scheme
LISP primitives on sequences
Presentation transcript:

KNOWLEDGE REPRESENTATION Lecture 2 Knowledge Representation

Knowledge Representation: Principles and Techniques Lexical ambiguity of natural language “Visiting aunts can be a nuisance” Need for common sense knowledge “The hammer hit the vase and it broke” “The vase hit the wall and it broke” “the X hit the Y and it broke” In each of the above, what does ‘it’ refer to ? Lecture 2 Knowledge Representation

Predicate-argument Expression <sentence><predicate>(<argument>,…,<argument>) e.g. at(robot, roomA) Interpretation: Robot is located in Room A (and not Room A is located at the robot) Lecture 2 Knowledge Representation

Knowledge Representation STRIPS Planner push(X,Y,Z) Preconditions: at(robot,Y), at(X,Y) Delete list: at(robot,Y), at(X,Y) Add list: at(robot,Z), at(X,Z) move(X,Y) Preconditions: at(robot,X) Delete list: at(robot,X) Add list: at(robot,Y) Lecture 2 Knowledge Representation

STRIPS Planner in Action Start at(robot,roomA) at(box1,roomB) at(box2,roomC) move(roomA,roomB) X/roomA,Y/roomB P: at(robot,roomA) D: at(robot,roomA) A: at(robot,roomB) push(box1,roomB,roomA) X/box1,Y/roomB,Z/roomA P: at(robot,roomB) P: at(box1,roomB) D: at(robot,roomB) D: at(box1,roomB) A: at(robot,roomA) A: at(box1,roomA) move(roomA,roomC) X/roomA,Y/roomC A: at(robot,roomC) push(box2,roomC,roomA) X/box2,Y/roomC,Z/roomA P: at(robot,roomC) P: at(box2,roomC) D: at(robot,roomC) D: at(box2,roomC) A: at(box2,roomA) Goal at(box1,roomA) at(box2,roomA) Lecture 2 Knowledge Representation

Knowledge Representation MYCIN Domain: treatment of blood infection Decision process: Deciding if patient has significant infection Determining possible organisms involved Selecting a set of appropriate drugs Choosing most appropriate drug(s) Lecture 2 Knowledge Representation

Organization of MYCIN Consultation program Explanation program Knowledge acquisition program Static knowledge base Dynamic patient data Physician user Infectious disease expert Lecture 2 Knowledge Representation

MYCIN’s Control Structure IF 1) there is an organism which requires therapy, and 2) consideration has been given to any other organisms requiring therapy THEN compile a list of possible therapies, and determine the best one in this list. Lecture 2 Knowledge Representation

Knowledge Representation Consultation Session Create the patient context as the top node in the context tree; Attempt to apply the goal rule to this patient context. Consultation is essentially a search through a tree of goals. The leaves of the tree as fact goals, such as laboratory data. Lecture 2 Knowledge Representation

An example of MYCIN’s rules IF 1) The stain of the organism is gramneg, and 2) The morphology of the organism is rod, and 3) The aerobicity of the organism is aerobic THEN There is strongly suggestive evidence (.8) that the class of the organism is enterobacteriaceae Lecture 2 Knowledge Representation

Knowledge Representation MYCIN Context Tree Patient-1 Culture-1 Culture-2 Culture-3 Operation-1 Organism-1 Organism-2 Organism-3 Drug-1 Drug-2 Lecture 2 Knowledge Representation

Example data for organism-1 GRAM = (GRAMNEG 1.0) MORPH = (ROD 0.8) (COCCUS 0.2) AIR = (AEROBIC 0.6) Considering the preceding rule, CF(premise) = min(1.0 , 0.8 , 0.6) = 0.6 CF(action) = CF(premise) × CF(rule) = 0.6 × 0.8 = 0.48 Lecture 2 Knowledge Representation

Knowledge Representation AND/OR Tree BADGE SHIELD GUN POLICE REVOLVER PISTOL RIFLE Lecture 2 Knowledge Representation

Knowledge Representation Evidence Combination Let X and Y be weights derived from the application of two different rules. Combined certainty of both rules: Lecture 2 Knowledge Representation

Knowledge Representation Evaluation of MYCIN Ratings by 8 experts on 10 cases Perfect score = 80 MYCIN 52 Actual Therapy 46 Faculty-1 50 Faculty-4 44 Faculty-2 48 Resident 36 Inf dis fellow Faculty-5 34 Faculty-3 Student 24 Lecture 2 Knowledge Representation

Comparing MYCIN and STRIPS Both have goal-driven control structure STRIPS is knowledge-poor (weak method) MYCIN is domain specific (strong method) Lecture 2 Knowledge Representation

Symbolic Representation Syntactic rules to form symbol structures out of symbols Transformation rules to turn symbol structures into other symbol structures Programs in such languages are themselves symbol structures Lecture 2 Knowledge Representation

Physical Symbol System Hypothesis “A physical symbol system has the necessary and sufficient means for general intelligent action” − Newell & Simon (1976) Lecture 2 Knowledge Representation

Symbol Structures in LISP LISP: LISt Processing LISP differs from most programming languages in three important respects: Its main data structure is the list; Its programs are also represented by list structures; and Its primitive operations are operations on lists. Lecture 2 Knowledge Representation

Knowledge Representation Lists and Dotted Pairs Any atom is an S-expression If A1 and A2 are S-expression, then (A1 . A2) is an S-expression If S = (A1 . (A2 . (… . (An-1 . An)…) is an S-expression for n>0, then S is a list if and only if An = NIL (S1 . (S2 . (S3 . NIL))) is simply (S1 S2 S3) (A . B) is not a list. It is a dotted pair. Lecture 2 Knowledge Representation

Knowledge Representation LISP Programs (<function> <1st argument> <2nd argument>) e.g. (+ X Y) To treat a list as merely a data structure rather than a program, use “quote” (quote X) or ’X ’( (1 2 3) (4 5 6) (7 8 9) ) Lecture 2 Knowledge Representation

Function Definition in LISP (defun <function name> (<formal parameters>) <function body> ) e.g. (defun SQUARE (X) (* X X ) ) Lecture 2 Knowledge Representation

Processing Association Lists (defun assoc (key alist) (cond ((null alist) NIL) ((eq (first (first alist)) key) (first alist)) (t (assoc key (rest alist)))) (assoc ’alaska ’( (alabama montgomey) (alaska juneau) …) ) Lecture 2 Knowledge Representation

Knowledge Representation Pattern Matching (defun match (sample pattern) (cond ((and (null sample) (null pattern)) T) ((or (null sample) (null pattern)) NIL) ((eq (first pattern) ’?) (match (rest sample) (rest pattern) ) ) ((eq (first sample) (first pattern) ) (T NIL) ) Lecture 2 Knowledge Representation

Pattern Matching (contd.) (match ’(at robot room) ’(at robot ?) ) T (match ’(at box room) ’(at robot ?) ) NIL (match ’(at robot room) ’(at ? ?) ) Lecture 2 Knowledge Representation

Function Definition in CLIPS (deffunction hypotenuse (?a ?b) (sqrt (+ (* ?a ?a) (* ?b ?b) ) ) ) (hypotenuse 3 4) 5.0 Lecture 2 Knowledge Representation

CLIPS for Rule-based Systems Freeware, available at: http://www.ghg.net/clips/CLIPS.html Borrows features from other tools Fairly standard LISP-like syntax Reasonably efficient Reasonably flexible Facilities for combining rules with objects Lecture 2 Knowledge Representation