Sujet : Re: Expert systems in forth
De : anton (at) *nospam* mips.complang.tuwien.ac.at (Anton Ertl)
Groupes : comp.lang.forthDate : 05. Jan 2025, 09:49:09
Autres entêtes
Organisation : Institut fuer Computersprachen, Technische Universitaet Wien
Message-ID : <2025Jan5.094909@mips.complang.tuwien.ac.at>
References : 1 2 3 4
User-Agent : xrn 10.11
minforth@gmx.net (minforth) writes:
Thank you for sharing your outstanding work here!
>
I don't think I understand the details of your program
but it seems to me way simpler than the famous Warren
Abstract Machine.
That would not surprise me, because Ahmed Melahi is implementing an
expert system framework, not Prolog (the progamming language for which
the WAM was designed). Like for all other expert system examples I
have seen (several, but no production expert systems), the examples do
not include any logic variables, and I guess that his system does not
support them; the majority of the complexity of implementing Prolog
and of the WAM comes from dealing with logic variables, which can
contain structures that themselves contain logic variables.
OTOH, Ahmed Melahi's expert system framework supports forward
chaining, while Prolog does not.
Another difference is that Prolog uses the closed-world-assumption (if
there is no fact for <something>, <something> is false), while Ahmed
Melahi's framework (and expert systems in general) asks the user for
input when it does not have a fact about <something>.
Unlike expert systems examples I have seen earlier, where the rules
led to a decision tree, trying some example leads to asking
apparently-redundant questions (not answering "yes" is the same as
answering "no"), e.g.:
verify: feathers <---
verify: wings <---
verify: lay-eggs <---
verify: hair <--- yes
apparently,
apparently,
verify: eat-vegetals <---
verify: eat-meat <--- yes
apparently,
apparently,
verify: hoofs <--- yes
apparently,
apparently,
verify: swim <--- yes
verify: black&white <---
verify: bird <---
verify: long-neck <---
verify: not-fly <--- yes
verify: black-stripes <---
verify: tawny-color <---
verify: herbivore <---
verify: long-legs <---
verify: dark-spots <---
verify: fly-well <---
verify: fly <---
apparently,
final result:
-------------
finally, ok
It seems that these additional questions are from having alternative
rules for the same thing, e.g.:
s" bird :- feathers .;"
>rules
s" bird :- wings , lay-eggs .;"
>rules
However, given that I answered "" (i.e., "no") to wings, there is no
reason for the system to ask me "lay-eggs". So I think that the
redundant questions are not just due to alternative rules, but also a
shortcoming of the system. Finally, the system could have found out
earlier (and printed more clearly that it knows of no animal that has
the properties that I answered with "yes". As for the animal
database, the Platypus would be an interesting addition.
- anton
-- M. Anton Ertl http://www.complang.tuwien.ac.at/anton/home.htmlcomp.lang.forth FAQs: http://www.complang.tuwien.ac.at/forth/faq/toc.html New standard: https://forth-standard.org/ EuroForth 2024: https://euro.theforth.net