The CLIPS Programming Tool History of CLIPS –Influenced by OPS5 and ART –Implemented in C for efficiency and portability –Developed by NASA, distributed.

Slides:



Advertisements
Similar presentations
Expert systems CLIPS Seyed Hashem Davarpanah
Advertisements

JavaScript FaaDoOEngineers.com FaaDoOEngineers.com.
Object Oriented Programming in Java George Mason University Fall 2011
(FO) Inference Methods CPSC 386 Artificial Intelligence Ellen Walker Hiram College.
Introduction to CLIPS COMP 474/674 FALL 2003 Michelle Khalifé.
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.
November 2, 2004AI: CLIPS Language Tutorial1 Artificial Intelligence CLIPS Language Tutorial Michael Scherger Department of Computer Science Kent State.
Chapter 8 Pattern Matching
© C. Kemke CLIPS 1 1 COMP 4200: Expert Systems Dr. Christel Kemke Department of Computer Science University of Manitoba.
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.
1 Computer Science Department California Polytechnic State University San Luis Obispo, CA, U.S.A. CPE/CSC 481: Knowledge-Based Systems Franz J. Kurfess.
Rule Based Systems Michael J. Watts
Chapter 11: Classes, Instances, and Message- Handlers Expert Systems: Principles and Programming, Fourth Edition.
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.
© C. Kemke CLIPS 1 1 COMP 4200: Expert Systems Dr. Christel Kemke Department of Computer Science University of Manitoba.
By: 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 9: Modular Design, Execution Control, and Rule Efficiency Expert Systems: Principles and Programming, Fourth Edition.
Introduction to Jess.
CS 561, Session 25 1 Introduction to CLIPS Overview of CLIPS Facts Rules Rule firing Control techniques Example.
C++ fundamentals.
Intro to Jess The Java Expert System Shell By Jason Morris Morris Technical Solutions.
Alternate Version of STARTING OUT WITH C++ 4 th Edition Chapter 1 Introduction to Computers and Programming.
CSC 125 Introduction to C++ Programming Chapter 1 Introduction to Computers and Programming.
FALL 2005CSI 4118 – UNIVERSITY OF OTTAWA1 Part 4 Web technologies: HTTP, CGI, PHP,Java applets)
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.
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.
Linux+ Guide to Linux Certification, Third Edition
Computer Programs and Programming Languages What are low-level languages and high-level languages? High-level language Low-level language Machine-dependent.
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.
Computer Science Department California Polytechnic State University San Luis Obispo, CA, U.S.A. Franz J. Kurfess CPE/CSC 481: Knowledge-Based Systems.
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>
Introduction to CLIPS. Expert Systems: Principles and Programming, Fourth Edition2 What is CLIPS? CLIPS is a multiparadigm programming language that provides.
1 Knowledge Based Systems (CM0377) Lecture 10 (Last modified 19th March 2001)
Copyright 2003 Scott/Jones Publishing Standard Version of Starting Out with C++, 4th Edition Chapter 1 Introduction to Computers and Programming.
Artificial Intelligence Lecture No. 19 Dr. Asad Ali Safi ​ Assistant Professor, Department of Computer Science, COMSATS Institute of Information Technology.
Today… “Hello World” ritual. Brief History of Java & How Java Works. Introduction to Java class structure. But first, next slide shows Java is No. 1 programming.
Mostly adopted from Jason Morris notes (Morris Technical Solutions)
Text TCS INTERNAL Oracle PL/SQL – Introduction. TCS INTERNAL PL SQL Introduction PLSQL means Procedural Language extension of SQL. PLSQL is a database.
PHP Tutorial. What is PHP PHP is a server scripting language, and a powerful tool for making dynamic and interactive Web pages.
Intelligent systems Lecture 11 Tools for development of Expert Systems.
The CLIPS Expert System Shell Dr Nicholas Gibbins
Linux Administration Working with the BASH Shell.
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.
Architecture Components
Chapter 7: Introduction to CLIPS
Chapter 8: Advanced Pattern Matching
بسم الله الرحمن الرحیم آموزش نرم افزار CLIPS
Chapter 11: Classes, Instances, and Message-Handlers
JESS (Java Expert System Shall)
CPE/CSC 481: Knowledge-Based Systems
Presentation transcript:

The CLIPS Programming Tool History of CLIPS –Influenced by OPS5 and ART –Implemented in C for efficiency and portability –Developed by NASA, distributed & supported by COSMIC –Runs on PC, Mac, also under UNIX and VAX VMS CLIPS provides mechanisms for expert systems –A top-level interpreter –Production rule interpreter –Object oriented programming language –LISP-like procedural language

Components of CLIPS Rule-Based Language –Can create a fact list –Can create a rule set –An inference engine matches facts against rules Object-Oriented Language –Can define classes –Can create different sets of instances –Special forms allow you to interface rules and objects

Defining Facts Facts can be asserted CLIPS> (assert (today is sunday)) Facts can be listed CLIPS> (facts) f-0 (today is sunday) Facts can be retracted CLIPS> (retract 0) CLIPS> (facts)

Managing Facts Clearing all facts CLIPS> (clear) CLIPS> (facts) Grouping facts - typically in a file (“today.clp”) (deffacts today; can be cleared with (undeffacts today) (today is sunday) (weather is warm) ) After loading facts, assert with (reset)

Defining Rules Rules have the following structure (defrule rule-name optional-comment optional-declaration condition... condition => action... action )

An Example CLIPS Rule (defrule sunday “Things to do on Sunday” (salience 0) ; salience in the interval [-10000, 10000] (today is Sunday) (weather is sunny) => (assert (chore wash car)) (assert (chore chop wood)) ) So, if fact list contains conditions, add assertions

Getting the Rules Started The reset command creates a special fact CLIPS> (load “today.clp”) CLIPS> (facts) CLIPS> (reset) CLIPS> (facts) f-0 (initial-fact)... (defrule start (initial-fact) => (printout t “hello”) )

Tracing & Recording Things Watch command can watch facts (and rules) CLIPS> (watch facts) CLIPS> (reset) ==> f-0 (initial-fact) CLIPS> (retract 0) <== f-0 (initial-fact) Contents of dialog window can be sent to file CLIPS> (dribble-on “dribble.clp”); any file name will do... CLIPS> (dribble-off “dribble.clp”)

Variables & Pattern Matching Variables make rules more applicable (defrule pick-a-chore (today is ?day) (chore is ?job) => (assert (do ?job on ?day)) ) If conditions are matched, then bindings are used

Retracting Facts from a Rule (defrule do-a-chore (today is ?day) ; ?day must have a consistent binding ?chore <- (do ?job on ?day) => (printout t ?job “ done”) (retract ?chore) ) We must assign a variable to item for retraction

Pattern Matching Details One-to-one matching (do ?job on ?day) (do washing on monday) Use of wild cards (do ? ? monday) (do ? on ?) (do ? ? ?day) (do $?) (do $? monday) (do ?chore $?when)

Using Templates (deftemplate student “a student record” (slot name (type STRING)) (slot age (type NUMBER) (default 18))) CLIPS> (assert (student (name fred))) (defrule print-a-student (student (name ?name) (age ?age)) => (printout t name? “ is “ ?age) )

Defining Functions in CLIPS Uses a LISP or Scheme-like syntax (deffunction function-name (arg... arg) action... action) (deffunction hypotenuse (?a ?b) (sqrt (+ (* ?a ?a) (* ?b ?b)))) (deffunction initialize () (clear) (assert (today is sunday)))

Defining Classes & Instances Defining the class CAR (defclass car (is-a user) (name) (made-by)) Defining an instance of CAR (make-instance corvette of car (made-by chevrolet))

Concrete & Abstract Classes Some classes only exist for inheritance purposes Person ManWoman JackJill

Managing Instances Commands to display instances CLIPS> (instances) [corvette] of car CLIPS> (send [corvette] print) [corvette] of car (made-by chevrolet) Command to group instances (in a file) (definstances (corvette of car (made-by chevrolet)) (thunderbird of car (made-by ford)))

Clearing & Resetting Instances Deleting an instance CLIPS> (send [corvette] delete) Deleting all instances CLIPS> (unmake-instance *) Resetting creates an initial object CLIPS> (reset) CLIPS> (instances) [initial-object] of INITIAL-OBJECT

Message Passing The SEND function (send [instance] message arg... arg) Converting from symbols to names CLIPS> (symbol-to-instance-name corvette) [corvette] This is useful when SENDing from inside a rule

Limitations of CLIPS Single level rule sets –in LOOPS, you could arrange rule sets in a hierarchy, embedding one rule set inside another, etc Loose coupling of rules and objects –rules can communicate with objects via message passing –rules cannot easily be embedded in objects, as in Centaur CLIPS has no explicit agenda mechanism –the basic control flow is forward chaining –to implement other kinds of reasoning you have to manipulate tokens in working memory

Alternatives to CLIPS Eclipse –has same syntax as CLIPS (both are based on ART) –supports goal-driven (i.e., backwards) reasoning –has a truth maintenance facility for checking consistency –can be integrated with C++ and dBase –new extension RETE++ can generate C++ header files NEXPERT OBJECT –another rule- and object-based system –has facilities for designing graphical interfaces –has a ‘script language’ for designing user front-end –written in C, runs on many platforms, highly portable