how to create Meta-rules and/or meta-interpreter for an Expert System with Swi-Prolog

依然范特西╮ 提交于 2020-01-11 07:21:26

问题


I wanna create an expert system with meta-interpreter with SWI-Prolog... what is the best and the easier way to make it? which is the procedure to make it?


回答1:


Many of the meta-interpreters for expert systems are based on the so called vanilla interpreter. This is an interpreter for Prolog without cut and without built-ins. it reads as follows:

solve(true) :- !.
solve((A,B)) :- !, solve(A), solve(B).
solve(H) :- clause(H,B), solve(B).

You can readily use it to solve the following knowledge base and query. In some Prolog systems, the more ISO compatible ones, you need to mark the predicates dynamic, so that clause/2 can find them:

pet(dog):- size(medium), noise(woof).
pet(cat):- size(medium), noise(meow).
pet(mouse):- size(small), noise(squeak).
size(medium).
noise(meow).

?- solve(pet(X)).
X=cat

Starting from the vanilla interpreter you can add various expert system like features:

  • Knowledge Acquisition
  • Explanations
  • Certainty Factors
  • Forward Chaining
  • Frame Representations
  • Etc...

Bye

P.S.: The following book shows how: http://www.amzi.com/ExpertSystemsInProlog/



来源:https://stackoverflow.com/questions/4165685/how-to-create-meta-rules-and-or-meta-interpreter-for-an-expert-system-with-swi-p

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!