Web Expert System Wwwgeni
In the catalogue <Vip_root>\www\programs\geni, there is a case that shows how to create a small expert system that works on the internet with CGI scripts supported by a Web server.
GENI uses very simple rules to express knowledge, and these rules apply when certain conditions are met.
Rule (1, "Carnivore", "Cheetah", [Up], "")
Rule (2, "Carnivore", "Tiger", [1,3], "")
Rule (3, "ungulate", "giraffe", [5,2,4], "" ")
Cond (1, "It has tawny color", "")
Cond (2, "It has dark spots", "" ")
Cond (3, "It has black stripes", "" ")
Geni is mainly used for the classification of things. Its goal is to describe things, not to implement advanced deductive engines. However, with its working principle, it can also build a complex expert system shell, which functions like the visual Prolog's own tool ESTA.
Geni has 3 Knowledge base (*. GNI files), involving animals, car start-up, tires, and other issues.
Non-network version of the Geni, question and answer, in a recursive manner. You cannot do this in a network version that uses CGI scripts. Because, in the question and answer consultation process, the CGI script work is intermittent incoherent. The biggest problem is how to save intermediate data for the consulting process
The existing solution is to save each user's answer in the hidden type variable of the Web page form. These intermediate data are passed backward by page. This CGI program GENI.EXE, each time you receive a user answer to start again, you must use the hidden variable to save the data, reinitialization. These intermediate data, retrieved by the predicate cgi_getstring and assert_conditions by the predicate, add the yes/no answer to the fact base. The fact base holds the previously answered conclusion, which is the precondition for the next inference.
The initial hidden variable, specifying the Knowledge base. The name of the GNI file. This is a necessary document for the consultation process.
The Web version Geni performs the following tasks (see Cheng code):
- Use predicate cgi_getstring to get the relevant CGI variable string.
- Converts the string to a list of structure data consisting of "name, value".
- Query the Knowledge Base. The knowledge base name, specified by the first hidden variable.
- The value of the relevant hidden variable is stored in the fact database as a precondition for further reasoning.
- Restart the inference engine.
The result of the inference machine running produces an HTML page containing a Hedden variable in the Form,form, and a query about the next inference precondition.
If the inference conclusion is obtained, Geni will generate the end page and give the result of the consultation.
Based on the reasoning prerequisites, new queries are constructed using HTML files or parts of the code.
A feature of the expert system, the user has the right to understand why the system is asking a question. The answer to this question, Geni, is to show the inference rules it is using, and the reasoning prerequisites that the user has previously answered.