Expert System and CLIPS
According to the wiki, “An expert system is a computer system that emerged from artificial intelligence research and emulates the decision-making abilities of human experts [1]. It is designed to solve complex problems by reasoning about knowledge, just like an expert, and does not follow procedures set by the software developer as in normal programming.
The basic behavior of the system is simple: the system selects the defined (declared) rules according to the input, and the final output is the result of applying all the rules. At the time when the expert system was introduced, machine learning technology was not so advanced, and these rules were mostly created manually. Therefore, it was difficult to build complex rules, and they were used not for large-scale AI systems but for applications that describe business rules in a limited domain.
In contrast, tools for learning large-scale rules and “explanatory machine learning” tools for verifying them have recently been proposed, opening the way to building large-scale expert systems.
In this blog, we discuss the following topics related to these expert systems.
- Expert System and CLIPS (this article)
- Backward and forward reasoning
- Expert Systems in Clojure Clara Rule and Rete4Frame
- Expert System with Clara Rule (1) Basic usage
- Expert System with Clara Rule (2) Advansed
One of the most famous tools for forward reasoning mentioned previous article is CLIPS. What is CLIPS? According to the wiki, “CLIPS is the name of a software and a type of expert system, which stands for C Language Integrated Production System. . The first version of CLIPS was developed in 1984 at NASA’s Johnson Space Center (as a successor to the existing ART*Inference system). . CLIPS is probably the most widely used expert system tool because it is fast, efficient, and free. It is now in the public domain, but is still being updated and supported by its original author, Gary Riley. And so on. CLIPS is a dedicated expert system tool that can also be configured with the aforementioned prolog.
CLIPS is available for download from the official website, or you can download the app and run it from a terminal on mac, or a richer multi-screen IDE on windows. (Unconfirmed).
The code is LISP-like, as shown below.
CLIPS>(+ 3 4)
7
CLIPS>(exit)
For use as an expert system, FACT is first introduced in the following way
CLIPS>
(deftemplate person
(slot name)
(slot age)
(slot eye-color)
(slot hair-color)
CLIPS>
(asset (person (name "John Q.Public))
(age 21)
(eye-color blue)
(hair-color black))
(person (name "Jane Q. Public"))
(age 36)
(eye-color green)
(hair-color red)))
<Fact-1>
CLIPS>
In addition, FACT data can be manipulated using the modify and duplicate functions. In addition, the FACT data can be manipulated by the modify function, duplicate function, etc. The deffact function can also be used to set the FACT. The next step is to set the rule as follows
CLIPS>(deftemplate emergency (slot type))
CLIPS>(deftemplate response (slot action))
CLIPS>(defrule fire-emergency "An example rule"
(emergency (type fire))
=>
(assert (response (action activate-sprinkler-system))))
This represents “IF the emergency is a fire then the response is activate the sprinkler system”. After declaring them, they can be executed using the (run) command.
See the reference manual for more details on its use.
Examples of implementing and using these in Clojure are described separately
コメント