如何使用Swi-Prolog为专家系统创建元规则和/或元解释器 [英] how to create Meta-rules and/or meta-interpreter for an Expert System with Swi-Prolog

查看:188
本文介绍了如何使用Swi-Prolog为专家系统创建元规则和/或元解释器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想用带有SWI-Prolog的元解释器创建一个专家系统...什么是最好的和更容易的方法?制作步骤是什么?

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?

推荐答案

许多用于专家系统的元解释器都基于 所谓的香草翻译.这是一个口译员 没有剪切和没有内置的Prolog.内容如下:

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).

您可以轻松地使用它来解决以下知识库 和查询.在某些Prolog系统中,与ISO更加兼容的系统中,您需要将谓词标记为动态,以便第2条可以找到它们:

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:

  • 知识获取
  • 说明
  • 确定性因素
  • 转发链
  • 框架表示
  • 等等...

再见

P.S .:下面的书显示了如何: http://www.amzi.com/ExpertSystemsInProlog/

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

这篇关于如何使用Swi-Prolog为专家系统创建元规则和/或元解释器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆