November 2, 2004AI: CLIPS Language Tutorial1 Artificial Intelligence CLIPS Language Tutorial Michael Scherger Department of Computer Science Kent State.

Slides:



Advertisements
Similar presentations
Expert systems CLIPS Seyed Hashem Davarpanah
Advertisements

10/4/2003COMP 474/674 Fall 2003 Michelle Khalife1 Conflict Resolution in CLIPS COMP 474/674 FALL 2003 Michelle Khalifé.
Special Education Student Information System Project New York City Department of Education | Special Education Student Information System Project 1 SESIS.
(FO) Inference Methods CPSC 386 Artificial Intelligence Ellen Walker Hiram College.
Introduction to CLIPS COMP 474/674 FALL 2003 Michelle Khalifé.
The CLIPS Programming Tool History of CLIPS –Influenced by OPS5 and ART –Implemented in C for efficiency and portability –Developed by NASA, distributed.
CLIPS 1 Expert Systems Dr. Samy Abu Nasser. CLIPS 2 Course Overview u Introduction u CLIPS Overview u Concepts, Notation, Usage u Knowledge Representation.
November 2, 2004AI: CLIPS Language Tutorial1 CLIPS Michael Scherger Department of Computer Science Kent State University.
Expert System Shells - Examples
Samad Paydar Ferdowsi University of Mashhad.  C Language Integrated Production System (CLIPS)  A tool for building expert systems  An expert system.
1 01/12/2011Knowledge-Based Systems, Paula Matuszek Intro to CLIPS Paula Matuszek CSC 9010, Spring, 2011.
Chapter 8 Pattern Matching
© C. Kemke CLIPS 1 1 COMP 4200: Expert Systems Dr. Christel Kemke Department of Computer Science University of Manitoba.
Simple Rule Based Systems Directly implementing rule based systems in Java Need vocabulary Simplicity sometimes works.
Introduction to CLIPS (Lecture Note #17)
Chapter 7: Introduction to CLIPS
CLIPS C Language Integrated Production System Note: Some slides and/or pictures are adapted from Lecture slides / Books of Dr Zafar Alvi.
Artificial Intelligence Lecture No. 18 Dr. Asad Ali Safi ​ Assistant Professor, Department of Computer Science, COMSATS Institute of Information Technology.
Introduction to CLIPS (Chapter 7) Fact List (contains data) Knowledge Base (contains rules) Inference Engine (controls execution)
© Franz J. Kurfess CLIPS 1 CPE/CSC 481: Knowledge-Based Systems Dr. Franz J. Kurfess Computer Science Department Cal Poly.
CSE (c) S. Tanimoto, 2007 Python Introduction 1 Introduction to Python for Artificial Intelligence Outline: Why Python? Interactive programming,
Expert Systems 3 1 Rewriting Rules, CLIPS Content of this lecture: 1.Interpretation of rules 2.Example: CLIPS Sorting 3.Non-determinism 4.Control regimes:
Mary Lou Maher MIT Fall 2002 Jess: A Production System Language Agent-Based Virtual Worlds.
© C. Kemke CLIPS 1 1 COMP 4200: Expert Systems Dr. Christel Kemke Department of Computer Science University of Manitoba.
© C. Kemke Control 1 COMP 4200: Expert Systems Dr. Christel Kemke Department of Computer Science University of Manitoba.
Chapter 8: Advanced Pattern Matching Expert Systems: Principles and Programming, Fourth Edition.
Chapter 9: Modular Design, Execution Control, and Rule Efficiency Expert Systems: Principles and Programming, Fourth Edition.
CS 106 Introduction to Computer Science I 03 / 19 / 2008 Instructor: Michael Eckmann.
Introduction to Jess.
Jess Presentation by Chun Ping Wang. What is Jess? Jess is an expert system shell made for java. Rete pattern algorithm. Purpose. –Jess is best use for.
CS 561, Session 25 1 Introduction to CLIPS Overview of CLIPS Facts Rules Rule firing Control techniques Example.
1 01/12/2011Knowledge-Based Systems, Paula Matuszek More Intro to CLIPS Paula Matuszek CSC 9010, Spring, 2011.
Chapter 9: Modular Design, Execution Control, and Rule Efficiency Expert Systems: Principles and Programming, Fourth Edition.
Review Topics Test 1. Background Topics Definitions of Artificial Intelligence & Turing Test Physical symbol system hypothesis vs connectionist approaches.
Expert System Topic 2.
1 Programming a Knowledge Based Application. 2 Overview.
Chapter 7: Introduction to CLIPS Expert Systems: Principles and Programming, Fourth Edition.
Artificial Intelligence Lecture No. 17 Dr. Asad Ali Safi ​ Assistant Professor, Department of Computer Science, COMSATS Institute of Information Technology.
Chapter 10: Procedural Programming Expert Systems: Principles and Programming, Fourth Edition.
August 29, 2005ICP: Chapter 1: Introduction to Python Programming 1 Introduction to Computer Programming Chapter 1: Introduction to Python Programming.
Expert Systems An Introduction to Expert Systems and CLIPS by Charles Weddle.
Pattern-directed inference systems
Jess: A Rule-Based Programming Environment Reporter: Yu Lun Kuo Date: April 10, 2006 Expert System.
Java Expert System Shell JESS 報告者 : 江梓安. Why we need an expert systems? Conventional programming languages Conventional programming languages Complex.
Chapter 7: Introduction to CLIPS Presented By: Farnaz Ronaghi.
IMSS013 CLIPS. 2 Background CLIPS is an expert system tool developed by the Software Technology Branch (STB), NASA/Lyndon B. Johnson Space Center. First.
Expert Systems Chapter 7 Introduction to CLIPS Entering and Exiting CLIPS A> CLIPS  CLIPS (V6.5 09/01/97) CLIPS> exit exit CLIPS> (+ 3 4)  7 CLIPS>
Advanced Pattern Matching. Field constraints Used to restrict the values of a field on LHS of a rule Used to restrict the values of a field on LHS of.
Artificial Intelligence Lecture No. 26 Dr. Asad Ali Safi ​ Assistant Professor, Department of Computer Science, COMSATS Institute of Information Technology.
Logical and Functional Programming
Artificial Intelligence Lecture No. 24 Dr. Asad Ali Safi ​ Assistant Professor, Department of Computer Science, COMSATS Institute of Information Technology.
Introduction to CLIPS. Expert Systems: Principles and Programming, Fourth Edition2 What is CLIPS? CLIPS is a multiparadigm programming language that provides.
Artificial Intelligence Lecture No. 19 Dr. Asad Ali Safi ​ Assistant Professor, Department of Computer Science, COMSATS Institute of Information Technology.
Artificial Intelligence Lecture No. 23 Dr. Asad Ali Safi ​ Assistant Professor, Department of Computer Science, COMSATS Institute of Information Technology.
Mostly adopted from Jason Morris notes (Morris Technical Solutions)
CS 106 Introduction to Computer Science I 03 / 22 / 2010 Instructor: Michael Eckmann.
Artificial Intelligence Lecture No. 22 Dr. Asad Ali Safi ​ Assistant Professor, Department of Computer Science, COMSATS Institute of Information Technology.
The CLIPS Expert System Shell Dr Nicholas Gibbins
Summary for final exam Agent System..
Introduction to CLIPS 2 Session 13 Course: T0273 – EXPERT SYSTEMS Year: 2014.
Jörg Kewisch, June 10, 2013, LILUG Meeting CLIPS C Language Integrated Production System Developed at the Software Development Branch, NASA Lyndon B. Johnson.
Intelligent Systems JESS constructs.
Chapter 7: Introduction to CLIPS
Intro to Jess The Java Expert System Shell
Chapter 8: Advanced Pattern Matching
بسم الله الرحمن الرحیم آموزش نرم افزار CLIPS
JESS (Java Expert System Shall)
Jess Knowledge, Influence, Behavior
CPE/CSC 481: Knowledge-Based Systems
Computer Based Tutoring
Presentation transcript:

November 2, 2004AI: CLIPS Language Tutorial1 Artificial Intelligence CLIPS Language Tutorial Michael Scherger Department of Computer Science Kent State University

November 2, 2004AI: CLIPS Language Tutorial2 Introduction CLIPS is a tool for building expert systems –Originally developed by the Software Technology Branch (STB) at NASA Johnson Space Center –First release in 1986 Web location –

November 2, 2004AI: CLIPS Language Tutorial3 Introduction CLIPS was designed to facilitate the development of software to model human knowledge –Facts –Rules –Deffunctions and generic functions –Object oriented programming

November 2, 2004AI: CLIPS Language Tutorial4 Starting / Exiting CLIPS To start CLIPS (Windows)…just double click the CLIPSWin.exe icon To exit CLIPS type (exit) at the CLIPS> prompt.

November 2, 2004AI: CLIPS Language Tutorial5 Facts Fact Assertion –(assert (play Ivan tennis)) –(assert (duck)) –(assert (chair red)) As facts are entered into the KB, they are assigned a Fact Index –(retract 1) Removes fact 1 from the KB –(clear) Removes all facts from the fact base and KB

November 2, 2004AI: CLIPS Language Tutorial6 Facts Fact Assertion –(facts) Dump the “fact base” Fact identifier – “time tag” –f-0 –f-1 –Special fact (initial-fact) Is always F0 and is used to match the first/start rules

November 2, 2004AI: CLIPS Language Tutorial7 Facts deffacts is a way of initializing the fact base (group of facts) Example: (deffacts tennis-players “people who play tennis” (athelete Ivan very-good) (play Ivan tennis) (athelete Martina very-good) (play Martina tennis)) Will cause the fact base to be initialized with the facts + (initial-fact)

November 2, 2004AI: CLIPS Language Tutorial8 Facts When (reset) is entered, the result is… f-0(initial-fact) f-1(athelete Ivan very-good) f-2(play Ivan tennis) f-3(athelete Martina very-good) f-4(play Martina tennis)

November 2, 2004AI: CLIPS Language Tutorial9 Rules Syntax (defruler-name“comment” pattern-1 … pattern-n => action-1 … action-m)

November 2, 2004AI: CLIPS Language Tutorial10 Rules r-name is the rule name comment must be surrounded by quotes pattern-i is the antecedent pattern action-j is the consequent pattern

November 2, 2004AI: CLIPS Language Tutorial11 Rules The agenda is the list of rules that have been matched and are waiting execution (agenda) will print out the rules The agenda is prioritized by salience value –Salience is specified by the programmer and is from to –Default is 0 if (declare (salience 25)) is not in rule e.g. –Rules are selected for firing by salience –Two rules of same salience use LIFO to fire

November 2, 2004AI: CLIPS Language Tutorial12 Rules (pprule r-name) will pretty print out the rule (excise r-name) will remove a rule from the system

November 2, 2004AI: CLIPS Language Tutorial13 Variables Variables start with a ? –E.g. ?age –Bindings are valid within a rule only

November 2, 2004AI: CLIPS Language Tutorial14 Fact Base Updates (retract fact-id) –requires “fact” to be the index number which is sometime difficult to determine –Therefore use variable with <- notation which binds the fact index number to the variable

November 2, 2004AI: CLIPS Language Tutorial15 Fact Base Updates Example (defrule become-adult ?child <- (child harry) (birthday harry August-15) ?age <- (age harry 17) (date today August-15) => (assert (adult harry)) (retract ?child) (retract ?age) (assert (age harry 18)) (printout t “harry is now an adult” crlf)) What facts are retracted? What facts are kept? What facts are generated? Changing harry to ?person and August-15 to ?date will generalize this rule

November 2, 2004AI: CLIPS Language Tutorial16 Firing Rules

November 2, 2004AI: CLIPS Language Tutorial17 Firing Rules

November 2, 2004AI: CLIPS Language Tutorial18 Firing Rules (Matching)

November 2, 2004AI: CLIPS Language Tutorial19 Firing Rules (Matching)

November 2, 2004AI: CLIPS Language Tutorial20 Wildcard Matching ? –matches one $? –matches any number $?name –match and bind

November 2, 2004AI: CLIPS Language Tutorial21 Variables, Variables, Variables Variables start with a ? Examples ?x?sensor?color ?location?room?size

November 2, 2004AI: CLIPS Language Tutorial22 Variables, Variables, Variables

November 2, 2004AI: CLIPS Language Tutorial23 Wildcard Matching Example (name ? ?Kennedy) –will match (name John Fitzgerald Kennedy) (name ? $? SMITH) –will match (name John SMITH) (name Suzie Jane SMITH) (name John James Jones SMITH) –but would not match (name SMITH) (name John Jones SMITH Rogers) $?name is the same as the previous but the matches are bound to $?name

November 2, 2004AI: CLIPS Language Tutorial24 Wildcard Matching

November 2, 2004AI: CLIPS Language Tutorial25 Field Constraints Negation ~ (defrule apply-heat (temperature water ~boil) => (adjust heat maximum); a function call (printout t “Turn the heat to the maximum setting” crlf))

November 2, 2004AI: CLIPS Language Tutorial26 Field Constraints OR | (defrule apply-heat (temperature water cold|cool|warm) => (adjust heat maximum); a function call (printout t “Turn the heat to a medium setting” crlf))

November 2, 2004AI: CLIPS Language Tutorial27 Field Constraints AND & (temperature water ?temp&hot|boil) –will match either of the following facts (temperature water hot) (temperature water boil)

November 2, 2004AI: CLIPS Language Tutorial28 Mathematical Operators Uses prefix notation as in Lisp (+ 3 4) (+ (* 3 4) (* 5 6)) Use = as assignment for fact assertion on left hand side (assert (answer = ( * 3 4 ) ) ) –put (answer 12) –in the fact list

November 2, 2004AI: CLIPS Language Tutorial29 Systematic Manner

November 2, 2004AI: CLIPS Language Tutorial30 Templates