How to create meta-rules and / or meta-interpreter for expert system with Swi-Prolog

I want to create an expert system with a meta-interpreter using SWI-Prolog ... what is the best and easiest way to do this? is it a procedure to do this?

+1
source share
1 answer

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

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

You can easily use it to solve the following knowledge base and query. On some Prolog systems, which are more compatible with ISO, it is necessary to mark predicates as dynamic so that the / 2 section 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

, , :

  • Etc...

Bye

..: , :http://www.amzi.com/ExpertSystemsInProlog/

+2

All Articles