Warning: mysqli::__construct(): (HY000/1203): User howardkn already has more than 'max_user_connections' active connections in D:\Inetpub\vhosts\howardknight.net\al.howardknight.net\includes\artfuncs.php on line 21
Failed to connect to MySQL: (1203) User howardkn already has more than 'max_user_connections' active connections
Warning: mysqli::query(): Couldn't fetch mysqli in D:\Inetpub\vhosts\howardknight.net\al.howardknight.net\index.php on line 66
Article <a489c8f27620718e4eb53a7fd349040e@www.novabbs.com>
Deutsch   English   Français   Italiano  
<a489c8f27620718e4eb53a7fd349040e@www.novabbs.com>

View for Bookmarking (what is this?)
Look up another Usenet article

Path: news.eternal-september.org!eternal-september.org!feeder3.eternal-september.org!i2pn.org!i2pn2.org!.POSTED!not-for-mail
From: melahi_ahmed@yahoo.fr (ahmed)
Newsgroups: comp.lang.forth
Subject: Re: Expert systems in forth
Date: Sat, 4 Jan 2025 11:41:27 +0000
Organization: novaBBS
Message-ID: <a489c8f27620718e4eb53a7fd349040e@www.novabbs.com>
References: <069d1724f6056b4c36d9e1ffaa3d606d@www.novabbs.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Info: i2pn2.org;
	logging-data="1963614"; mail-complaints-to="usenet@i2pn2.org";
	posting-account="t+/9LUKLIiUqIe6reyFE7me/EcA/Gr17dRXgwnADesE";
User-Agent: Rocksolid Light
X-Rslight-Posting-User: 5f6b2e70af503e44dad56966aa15d35bdef29623
X-Spam-Checker-Version: SpamAssassin 4.0.0
X-Rslight-Site: $2y$10$2PCAGPb9OSFx7sdxJRR3WuBBurdcHy2pMQsMjyuY/ZCQSi8IXZ9yy

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

--