Re: Expert systems in forth
Sujet : Re: Expert systems in forth
De : melahi_ahmed (at) *nospam* yahoo.fr (ahmed)
Groupes : comp.lang.forthDate : 04. Jan 2025, 12:41:27
Autres entêtes
Organisation : novaBBS
Message-ID : <a489c8f27620718e4eb53a7fd349040e@www.novabbs.com>
References : 1
User-Agent : Rocksolid Light
The animal.fs file:
include expert_systems.fs
\ facts
4 facts pointed-teeth claws swim forward-eyes
4 facts hoofs bird give-milk fly
4 facts hair chew-cud feathers lay-eggs
4 facts not-fly tawny-color fly-well dark-spots
4 facts black&white long-legs mammal black-stripes
4 facts carnivore long-neck ungulate eat-meat
4 facts wings bat eat-vegetals herbivore
4 facts cheetah tiger giraffe zebra
4 facts bat ostrich penguin albatros
\ rules
s" bird :- feathers .;" >rules
s" bird :- wings , lay-eggs .;" >rules
s" mammal :- hair .;" >rules
s" mammal :- give-milk .;" >rules
s" herbivore :- eat-vegetals .;" >rules
s" carnivore :- eat-meat .;" >rules
s" carnivore :- pointed-teeth , claws , forward-eyes .;" >rules
s" ungulate :- mammal , hoofs .;" >rules
s" ungulate :- mammal , chew-cud .;" >rules
s" penguin :- swim , black&white , bird , fly notfact .;" >rules
s" ostrich :- black&white , bird , long-neck , not-fly .;" >rules
s" tiger :- black-stripes , carnivore , tawny-color , mammal .;" >rules
s" giraffe :- herbivore , long-neck , ungulate , long-legs ,
dark-spots .;" >rules
s" cheetah :- dark-spots , tawny-color , carnivore , mammal .;" >rules
s" albatros :- fly-well , bird .;" >rules
s" zebra :- herbivore , ungulate , black-stripes .;" >rules
s" bat :- wings , fly , mammal .;" >rules
\ results
: _penguin_ s" It is a penguin." ;
: _ostrich_ s" It is an ostrich." ;
: _tiger_ s" It is a tiger." ;
: _giraffe_ s" It is a giraffe." ;
: _cheetah_ s" It is a cheetah." ;
: _albatros_ s" It is an albatros." ;
: _zebra_ s" It is a zebra." ;
: _bat_ s" It is a bat." ;
\ results in facts actions
s" _zebra_ cr type" zebra action>fact
s" _albatros_ cr type" albatros action>fact
s" _cheetah_ cr type" cheetah action>fact
s" _giraffe_ cr type" giraffe action>fact
s" _tiger_ cr type" tiger action>fact
s" _ostrich_ cr type" ostrich action>fact
s" _penguin_ cr type" penguin action>fact
s" _bat_ cr type" bat action>fact
Ahmed
--
Haut de la page
Les messages affichés proviennent d'usenet.
NewsPortal