2
Downloaded by UNIV OF CALIFORNIA SANTA BARBARA on March 5, 2018 | https://pubs.acs.org Publication Date: April 30, 1986 | doi: 10.1021/bk-1986-0306.ch002
A Knowledge-Engineering Facility for Building Scientific Expert Systems Charles E . Riese and J . D. Stuart Radian Corporation, Austin, T X 78766-0948
RuleMaster is a general-purpose software package for building and delivering expert systems. Its features include 1) knowledge acquisition by inductive learning, 2) specialized a r t i f i c i a l intelligence programming s k i l l s are not required, and 3) it runs on a wide range of micro-computers and mini-computers. RuleMaster was developed to enable scientists and engineers to incorporate human-like decision making as part of their computer applications. One such application is TOGA, an expert system to diagnose faults in large transformers based on gas chromatographic analysis of the insulating oil. An e x p e r t system i s a computer program w h i c h c o n t a i n s t h e c a p t u r e d knowledge o f an e x p e r t i n some s p e c i f i c domain. The program i s a b l e t o g i v e a d v i c e w i t h i n t h e d o m a i n i n much t h e same manner as t h e human e x p e r t w o u l d , a s k i n g f o r i n f o r m a t i o n as i t i s n e e d e d , v o l u n t e e r i n g p a r t i a l diagnoses as t h e y a r e r e a c h e d , and f u n c t i o n i n g w i t h incomplete or p o s s i b l y erroneous i n f o r m a t i o n . The e x p e r t s y s t e m i s a b l e t o p r o v i d e an e x p l a n a t i o n o f t h e l i n e o f r e a s o n i n g upon demand. U n t i l r e c e n t l y , most e x p e r t system b u i l d i n g t o o k p l a c e i n t h e r e s e a r c h departments o f u n i v e r s i t i e s and a few major c o r p o r a t i o n s . The p r i m a r y e m p h a s i s was i n v e s t i g a t i o n o f a r t i f i c i a l i n t e l l i g e n c e p r i n c i p l e s , a n d t h e a p p l i c a t i o n was o f s e c o n d a r y i m p o r t a n c e . The e x p e r t systems t o o l s used r e f l e c t t h i s i n t e r e s t . They a r e t y p i c a l l y s t a n d - a l o n e A I computer systems, u s i n g s p e c i a l hardware and s o f t w a r e environments ( u s u a l l y L i s p ^ b a s e d ) not commonly found i n s c i e n t i f i c and e n g i n e e r i n g o r g a n i z a t i o n s . But a p p l i c a t i o n s u s u a l l y n e e d a d i f f e r e n t t y p e o f computing environment. The r e a s o n i n g t a s k , a c c o m p l i s h e d b y A I t e c h n i q u e s , o f t e n c o n s t i t u t e s t e n p e r c e n t o r l e s s o f t h e code o f an a p p l i c a t i o n . The m a j o r i t y o f t h e code i s f o r c o n v e n t i o n a l programming t a s k s , such as d a t a a c q u i s i t i o n , d a t a base a c c e s s , n u m e r i c a l c a l c u l a t i o n s , and graphics. I n each a p p l i c a t i o n domain, computer hardware and s o f t w a r e has b e e n s e l e c t e d t o m a t c h t h e n e e d s o f i t s t a s k s . In 0097-6156/86/0306-0018$06.00/0 © 1986 American Chemical Society
Pierce and Hohne; Artificial Intelligence Applications in Chemistry ACS Symposium Series; American Chemical Society: Washington, DC, 1986.
Downloaded by UNIV OF CALIFORNIA SANTA BARBARA on March 5, 2018 | https://pubs.acs.org Publication Date: April 30, 1986 | doi: 10.1021/bk-1986-0306.ch002
2.
RIESE A N D STUART
A Knowledge-Engineering Facility
19
e s t a b l i s h e d f i e l d s l i k e c h e m i s t r y , computer s o l u t i o n s have been i m p l e m e n t e d and i n use f o r y e a r s . I t i s n o t r e a s o n a b l e f o r t h e A I component, a r e l a t i v e l y s m a l l a d d i t i o n t o t h e t o t a l s y s t e m , t o d i c t a t e major changes t o t h e computing environment. W h i l e t h e o r i g i n a l e x p e r t system approaches were s u i t a b l e f o r A I r e s e a r c h , s e v e r a l t y p e s o f p r o b l e m s a r e e n c o u n t e r e d when t h e emphasis i s s h i f t e d t o s c i e n t i f i c e x p e r t system a p p l i c a t i o n s . In t h e o r i g i n a l a p p r o a c h e s , e x p e r t s y s t e m b u i l d i n g i s s l o w and e x p e n s i v e due t o t h e amount o f e x p e r t a n d k n o w l e d g e e n g i n e e r t i m e r e q u i r e d t o e x p r e s s and t e s t r u l e s . The c o s t o f A I h a r d w a r e a n d s p e c i a l A I p r o g r a m m e r s makes s m a l l a p p l i c a t i o n s p r o h i b i t i v e l y expensive. The e x p e r t systems a r e s t a n d - a l o n e programs, and i t i s d i f f i c u l t or i m p o s s i b l e t o i n t e g r a t e t h e i r reasoning w i t h e x i s t i n g s c i e n t i f i c software. Sometimes, f i n i s h e d e x p e r t systems can not be used i n the f i e l d because they are too s l o w , or r e q u i r e i n a p p r o p r i a t e l y e x p e n s i v e hardware. B e c a u s e o f t h e c u r r e n t h i g h demand f o r e x p e r t s y s t e m a p p l i c a t i o n s , s o f t w a r e packages w h i c h a r e o p t i m i z e d f o r a p p l i c a t i o n building, rather than for AI technique research, h a v e been developed. One o f t h e s e i s R u l e M a s t e r (l) which i s designed to e x t r a c t e x p e r t r e a s o n i n g and t o i n c o r p o r a t e i t i n t o a w i d e range o f s c i e n t i f i c a n d e n g i n e e r i n g a p p l i c a t i o n s . I n c o n t r a s t w i t h many o t h e r A I approaches, R u l e M a s t e r i s based on contemporary s t r u c t u r e d programming p r i n c i p l e s . C o n v e n t i o n a l m i c r o - and m i n i - c o m p u t e r s may be u s e d b y a n y c o m p u t e r p r o f e s s i o n a l t o b u i l d e x p e r t s y s t e m s i n t e g r a t e d w i t h e x i s t i n g computer programs. A knowledge a c q u i s i t i o n system based on i n d u c t i v e l e a r n i n g speeds up t h e r u l e g e n e r a t i o n and t e s t i n g process. A p r o c e d u r a l r e p r e s e n t a t i o n o f the r u l e base i s a u t o m a t i c a l l y g e n e r a t e d , p r o v i d i n g c o n s i s t e n c y and c o m p l e t e n e s s c h e c k i n g and e f f i c i e n t r u n - t i m e b e h a v i o r . Embedding e x p e r t system r e a s o n i n g i n t o e x i s t i n g systems i s s u p p o r t e d by two f e a t u r e s : a c c e s s t o e x t e r n a l u s e r programs from t h e R u l e M a s t e r r u l e l a n g u a g e , and t h e a u t o m a t i c g e n e r a t i o n o f a C c o d e r e p r e s e n t a t i o n o f t h e expert system. 9
RuleMaster D e s c r i p t i o n History. R a d i a n C o r p o r a t i o n i s a t e c h n i c a l c o n s u l t i n g company, e m p l o y i n g about 1000 p e o p l e . About h a l f o f R a d i a n ' s b u s i n e s s i s i n t h e c h e m i s t r y and c h e m i c a l e n g i n e e r i n g f i e l d s . I n 1981, Radian management r e a l i z e d t h a t e x p e r t systems c a p a b i l i t y c o u l d enhance and complement e x i s t i n g c o n s u l t i n g a c t i v i t i e s . R a d i a n e n t e r e d i n t o an agreement w i t h D o n a l d M i c h i e , o f E d i n b u r g h U n i v e r s i t y and I n t e l l i g e n t T e r m i n a l s L i m i t e d (ITL). F o r a number o f y e a r s , he had done r e s e a r c h i n i n d u c t i v e l e a r n i n g a n d i n o t h e r e x p e r t s y s t e m t e c h n i q u e s , and o f t e n used c o n v e n t i o n a l s t r u c t u r e d programming languages l i k e P a s c a l . He n o t e d t h a t t h e s p e c i a l A I environments were p r i m a r i l y u s e f u l f o r r e s e a r c h i n t o A I t e c h n i q u e s , and were n o t n e c e s s a r y f o r an e x p e r t systems package o r i e n t e d toward b u i l d i n g applications. R u l e M a s t e r was d e s i g n e d a n d d e v e l o p e d by I T L a n d R a d i a n d u r i n g 1982 and 1 9 8 3 . S i n c e t h e n , b o t h companies have c o n t i n u e d e n h a n c i n g R u l e M a s t e r , and s e v e r a l d o z e n e x p e r t s y s t e m a p p l i c a t i o n s a r e under c o n s t r u c t i o n o r c o m p l e t e d .
Pierce and Hohne; Artificial Intelligence Applications in Chemistry ACS Symposium Series; American Chemical Society: Washington, DC, 1986.
20
ARTIFICIAL INTELLIGENCE APPLICATIONS IN CHEMISTRY
Downloaded by UNIV OF CALIFORNIA SANTA BARBARA on March 5, 2018 | https://pubs.acs.org Publication Date: April 30, 1986 | doi: 10.1021/bk-1986-0306.ch002
Components.
The two p r i n c i p l e components o f R u l e M a s t e r a r e :
Radial:
a procedural, block structured e x p r e s s i n g d e c i s i o n r u l e s , and
language
for
RuleMaker:
t h e knowledge a c q u i s i t i o n s y s t e m ; induces d e c i s i o n t r e e s from examples o f e x p e r t d e c i s i o n - m a k i n g , and e x p r e s s e s t h e s e d e c i s i o n s t r e e s as executable R a d i a l code,
R u l e M a s t e r e x p e r t s y s t e m s a r e r e p r e s e n t e d as R a d i a l programs. To b u i l d an e x p e r t system, domain knowledge i s n o r m a l l y e n t e r e d i n two parts: a m o d u l e s t r u c t u r e and t h e b o d i e s o f t h e m o d u l e s . The s t r u c t u r e d e f i n e s t h e h i e r a r c h i c a l o r g a n i z a t i o n o f d e c i s i o n s used t o s o l v e t h e p r o b l e m . The code w i t h i n each module d e f i n e s t h e d e t a i l s o f one o f t h e s e d e c i s i o n s . R u l e M a k e r i s a knowledge e x t r a c t i o n u t i l i t y f o r b u i l d i n g and t e s t i n g the d e c i s i o n l o g i c contained w i t h i n R a d i a l modules. The l o g i c i s s p e c i f i e d as a t a b l e o f e x a m p l e s o f c o r r e c t e x p e r t d e c i s i o n s f o r each module. R u l e M a k e r t r a n s f o r m s each example s e t i n t o an e q u i v a l e n t d e c i s i o n t r e e , and a u t o m a t i c a l l y generates t h e body o f t h e module i n t h e form o f R a d i a l code. System b u i l d e r s may a l s o choose t o e n t e r R a d i a l code d i r e c t l y , a l t h o u g h t h e y u s u a l l y p r e f e r t o work w i t h example t a b l e s . C o n s u l t a t i o n o f an e x p e r t system i s a c c o m p l i s h e d by u s i n g i t s R a d i a l code r e p r e s e n t a t i o n as i n p u t t o t h e R a d i a l i n t e r p r e t e r . The i n t e r p r e t e r f i r s t performs completeness and c o n s i s t e n c y c h e c k s , and then provides i n t e r a c t i v e run-time support. I n d u c t i v e L e a r n i n g ( R u l e M a k e r ) . Experts are best a b l e t o e x p l a i n complex concepts t o human a p p r e n t i c e s i m p l i c i t l y by u s i n g examples o f t h e e x p e r t ' s d e c i s i o n - m a k i n g , r a t h e r t h a n by e x p l i c i t l y s t a t i n g fundamental t h e o r e t i c a l p r i n c i p l e s . The a p p r e n t i c e quickly g e n e r a l i z e s t h e s e example d e c i s i o n s t o form w o r k i n g r u l e s , w h i c h he a p p l i e s when s i m i l a r s i t u a t i o n s a r e e n c o u n t e r e d . R u l e M a s t e r s knowledge a c q u i s i t i o n t o o l , R u l e M a k e r , employs a l e a r n i n g process s i m i l a r to that o f the apprentice. To t e a c h a concept t o R u l e M a k e r , t h e e x p e r t p r o v i d e s a s e t o f examples ( c a l l e d a t r a i n i n g s e t ) o f c o r r e c t d e c i s i o n s w i t h i n some c o n t e x t . Each t r a i n i n g set contains a l i s t o f the a t t r i b u t e s which are factors for d e t e r m i n i n g t h e c h o i c e o f a c t i o n . Each example c o n t a i n s a v a l u e f o r e a c h o f t h e a t t r i b u t e s , t o g e t h e r w i t h t h e s p e c i f i e d a c t i o n s t o be t a k e n when t h a t c o m b i n a t i o n o f a t t r i b u t e v a l u e s i s encountered. The R u l e M a k e r u t i l i t y c h e c k s e a c h t r a i n i n g s e t f o r c o m p l e t e n e s s and c o n s i s t e n c y , and t h e n g e n e r a t e s a p r o c e d u r a l r e p r e s e n t a t i o n o f t h e knowledge embodied i n t h e example. To i l l u s t r a t e t h i s , t h e e x a m p l e s e t o f F i g u r e 1 shows how a s i m p l e corona d e t e c t i o n d e c i s i o n ( l i k e l y , p o s s i b l e , or u n l i k e l y ) i n TOGA (Transformer O i l Gas A n a l y s i s ) might be s p e c i f i e d . TOGA i s an e x p e r t system t h a t diagnoses f a u l t s i n l a r g e e l e c t r i c a l t r a n s f o r m e r s a n d w i l l be d e s c r i b e d i n d e t a i l l a t e r i n t h i s p a p e r . The c o r o n a d e c i s i o n i s b a s e d on f o u r a t t r i b u t e s : H 2 , t h e r m a l , H 2 / C 2 H 2 , and temperature. The a t t r i b u t e " H 2 i s t h e c o n c e n t r a t i o n o f h y d r o g e n g a s ; i t may be l o w , medium, o r h i g h , a c c o r d i n g t o n u m e r i c a l r a n g e s f
I!
Pierce and Hohne; Artificial Intelligence Applications in Chemistry ACS Symposium Series; American Chemical Society: Washington, DC, 1986.
Downloaded by UNIV OF CALIFORNIA SANTA BARBARA on March 5, 2018 | https://pubs.acs.org Publication Date: April 30, 1986 | doi: 10.1021/bk-1986-0306.ch002
2.
RIESE A N D STUART
A Know ledge-Engineering Facility
21
s e t by t h e e x p e r t i n a n o t h e r R a d i a l m o d u l e . " T h e r m a l " r e f e r s t o t h e r m a l l y generated hydrocarbon g a s e s , w h i c h may be a b s e n t , s l i g h t , or d e f i n i t e l y p r e s e n t . The o t h e r two a t t r i b u t e s a r e t h e h y d r o g e n t o - a c e t y l e n e r a t i o and t h e e s t i m a t e o f t h e t e m p e r a t u r e a t w h i c h t h e h y d r o c a r b o n gases were generated. A h i e r a r c h y o f r u l e s s u p p l i e d by t h e e x p e r t determines t h e v a l u e o f each o f t h e s e a t t r i b u t e s , based e v e n t u a l l y on t h e n u m e r i c a l c o n c e n t r a t i o n s r e c e i v e d from t h e gas chromatograph. The d e c i s i o n f o r each example i s e x p r e s s e d as an " a c t i o n - n e x t state" pair. The " a c t i o n " i s a r e f e r e n c e t o e x e c u t a b l e R a d i a l code, w h i c h c o n s i s t s o f a sequence o f R a d i a l s t a t e m e n t s . These s t a t e m e n t s may c o n t a i n r e f e r e n c e s t o e x t e r n a l p r o g r a m s i n v a r i o u s l a n g u a g e s ( t h i s w i l l be d i s c u s s e d f u r t h e r l a t e r ) . The "next s t a t e " d e s c r i b e s the c o n t e x t t o which c o n t r o l i s t o pass a f t e r the a c t i o n i s c o m p l e t e d . F o r d i a g n o s t i c e x p e r t s y s t e m s , s u c h as TOGA, t h e n e x t s t a t e w i l l u s u a l l y be t h e " g o a l " s t a t e o f t h e module. T h i s passes c o n t r o l back t o t h e c a l l i n g module. F o r p r o c e d u r a l e x p e r t systems, s u c h as r o b o t i c s a n d i n s t r u m e n t a t i o n c o n t r o l a p p l i c a t i o n s , t h e c o n t r o l w i l l be t r a n s f e r r e d between s e v e r a l s t a t e s w i t h i n a module t o implement l o o p i n g . The d e c i s i o n t r e e f o r t h e t r a i n i n g s e t o f F i g u r e 1, as g e n e r a t e d b y R u l e M a k e r , i s shown i n F i g u r e 2. The g e n e r a t e d t r e e a g r e e s w i t h a l l d e c i s i o n s r e p r e s e n t e d i n t h e example s e t , and g e n e r a l i z e s to reach decisions for u n s p e c i f i e d portions of the space. The r u l e i n d u c t i o n a l g o r i t h m , c a l l e d ID3 ( 2 ) , uses i n f o r m a t i o n t h e o r e t i c t e c h n i q u e s t o r e d u c e t h e number o f d e c i s i o n nodes i n t h e g e n e r a t e d t r e e . R u l e Language ( R a d i a l ) . R u l e M a s t e r e x p e r t systems a r e e x p r e s s e d i n R a d i a l , a b l o c k s t r u c t u r e d i n t e r p r e t e d language w i t h a syntax s i m i l a r t o P a s c a l a n d ADA. R a d i a l i s a s i m p l e , e a s y - t o - l e a r n language which supports the f u l l range of expert system capabilities. The b u i l d i n g b l o c k o f R a d i a l , c o r r e s p o n d i n g t o t h e P a s c a l p r o c e d u r e , i s c a l l e d a "module". The s y n t a x w i t h i n each module i s based on f i n i t e automata t h e o r y , t o p r o v i d e t h e c o n t r o l s t r u c t u r e s needed t o s u p p o r t b o t h d i a g n o s t i c and p l a n n i n g a s p e c t s o f e x p e r t systems a p p l i c a t i o n s . Other language features include recursive r o u t i n e c a l l s , argument p a s s i n g , s c o p e d v a r i a b l e and f u n c t i o n s , a b s t r a c t d a t a t y p e s , and u s e r - d e f i n e d o v e r l o a d e d o p e r a t o r s . Builti n d a t a t y p e s i n c l u d e s t r i n g , i n t e g e r , f l o a t i n g p o i n t , and b o o l e a n . The R a d i a l c o d e f o r t h e d e c i s i o n t r e e o f F i g u r e 2 i s shown i n F i g u r e 3. T h i s c o d e was g e n e r a t e d b y R u l e M a k e r . Experts have d i f f i c u l t y c o r r e c t l y g e n e r a t i n g a d e e p l y n e s t e d c o n d i t i o n a l phrase l i k e t h i s , but t h e y are a b l e t o i n s p e c t i t f o r p o s s i b l e e r r o r s or omissions. TOGA u s e s t h e b u i l t - i n n u m e r i c a l c a p a b i l i t i e s o f R a d i a l t o compute f u n c t i o n s o f c o n c e n t r a t i o n v a l u e s , w h i c h are used e x t e n s i v e l y i n the r u l e s . The r a t i o o f h y d r o g e n t o a c e t y l e n e c o n c e n t r a t i o n i n t h e corona r u l e i s a s i m p l e example o f t h i s . Userd e f i n e d compound d a t a t y p e s a r e used t o h a n d l e b l o c k s o f d a t a as a s i n g l e named s t r u c t u r e . These f e a t u r e s a r e i n v a l u a b l e i n b u i l d i n g p r a c t i c a l e x p e r t systems, but a r e not a v a i l a b l e w i t h a l l packages. Most R a d i a l code i s c o n s t r u c t e d by R u l e M a k e r from t r a i n i n g s e t s
Pierce and Hohne; Artificial Intelligence Applications in Chemistry ACS Symposium Series; American Chemical Society: Washington, DC, 1986.
ARTIFICIAL INTELLIGENCE APPLICATIONS IN CHEMISTRY
22
H2 high med
Downloaded by UNIV OF CALIFORNIA SANTA BARBARA on March 5, 2018 | https://pubs.acs.org Publication Date: April 30, 1986 | doi: 10.1021/bk-1986-0306.ch002
high med high med med med low
-
thermal
H2/C2H2
absent
absent
absent present slight
action
next state GOAL) GOAL)
high high
low low
=> =>
( likely, I: l i k e l y ,
high high
moderate moderate
=> =>
< possible, ( possible,
high high
high high moderate moderate
=> => => => => =>
( ( ( ( ( (
-low
-— Figure
temperature
-—
unlikely, unlikely, unlikely, unlikely, unlikely, unlikely,
Example s e t f o r corona r u l e .
1.
unlikely
unlikely
marf unlikely
likely
likely
unlikely
( thermal )
absent possible F i g u r e 2.
Decision
possible